[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Switching between fullscreen and windowed mode?



The "only works correctly on software surfaces" part is a bit annoying though. It would be nice if this was a part of the SDL spec. After all, I assume most of us at least ask for a hardware surface.

On 10/26/06, René Dudfield <renesd@xxxxxxxxx> wrote:
From our friendly, food covered handwritten cookbook that I keep on
top of my fridge...

http://www.pygame.org/wiki/toggle_fullscreen?parent=CookBook


On 10/26/06, Joseph Quigley <cpu.crazy@xxxxxxxxx> wrote:
> How can I switch between windowed and fullscreen mode? I don't want to
> use pygame.display.toggle_fullscreen (because it doesn't seem to work
> with my code) and pygame.display.set_mode(resolution,
> pygame.FULLSCREEN) doesn't make a windowed version of my game when I
> restart it.
>
> Here's the some of the code I'm currently trying to get to work:
> if e.key == K_F10:
>                                 isFullScreen = self.settings['fullScreen']
>                                 isFullScreen = int(not isFullScreen)
>
>                                 # try to change the mode
>                                 base.setScreenMode((0,pygame.FULLSCREEN)[isFullScreen],int(self.settings['bpp']))
>                                 # save changes
>                                 self.settings ['fullScreen'] = isFullScreen
>                                 base.saveGameSettings(self.settings)
>                                 return 1
>
> self.settings["fullscreen"] can be either 1 for True or 0 for False.
> Thanks,
> Joe
> --
> All Your Base Are Belong To Us!!! chown -r us ./base
>
> "After three days without programming, life becomes meaningless.'' --
> Tao of Programming Book 2
>



--
Science is open source religion