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

Re: [pygame] Resetting display



No. Only X11, e.g. GNU/Linux (and I think Mac OS X is another example).

If you really want to use toggle_fullscreen when the program is run on X11 without also sacrificing platform-independence, you could do something like:

fullscreen = not fullscreen
if not pygame.display.toggle_fullscreen():
    if fullscreen:
        window = pygame.display.set_mode(size, FULLSCREEN)
    else:
        window = pygame.display.set_mode(size)

That's of course assuming that the most recent comment in the docs (from 12/30/2010) is right about what pygame.display.toggle_fullscreen returns.

--- On Wed, 5/9/12, Bartosz Debski <bartosz@xxxxxxxxxxxx> wrote:

> From: Bartosz Debski <bartosz@xxxxxxxxxxxx>
> Subject: Re: [pygame] Resetting display
> To: pygame-users@xxxxxxxx
> Date: Wednesday, May 9, 2012, 11:31 AM
> Well, i haven't tried to be honest
> but will toggle_fullscreen work
> under Windows ?
> 
> On Tue, May 8, 2012 at 10:32 AM, Radomir Dopieralski
> <pygame@xxxxxxxxxxxx>
> wrote:
> > On Tue, May 8, 2012 at 11:12 AM, Bartosz Debski <bartosz@xxxxxxxxxxxx>
> wrote:
> >> toggle_fullscreen will work only under X11.
> >
> > I didn't know you could run pygame outside of X11.
> >
> > [...]
> >
> > --
> > Radomir Dopieralski
>