[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Optimization, double buffered pygames



Another reason might be that your "content" surfaces (sprites, backgrounds,
etc.) are not in same format as the windowed display but in a different
format from the fullscreen display.  If this is the case, they will have to
be converted to the display format on every blit, which results in a big
performance hit. Convert all your content to the format of the display as
you load it from disk.

Alternatively, you might be requesting a pixel format that cannot be
supported by the hardware.  SDL will then emulate that pixel format in
software and convert each frame to the actual hardware format when it
updates the screen.  This is also a performance problem.  If this is the
case, query the display for native formats and choose the most appropriate
before opening the display.  If your program converts all content to the
display format, this change will not affect the rest of the code.

Cheers,
            Nat.

________________________________
Dr. Nathaniel Pryce
B13media Ltd.
Studio 3a, Aberdeen Business Centre, 22/24 Highbury Grove, London, N5 2EA
http://www.b13media.com

----- Original Message -----
From: "Pete Shinners" <pete@visionart.com>
To: <pygame-users@seul.org>
Sent: Monday, May 06, 2002 6:50 PM
Subject: Re: [pygame] Optimization, double buffered pygames


> Syver Enstad wrote:
> > Yes, I've considered that, but isn't it unlikely considering that the
> > game ran at 30 fps in fullscreen mode, after adding some more code it
> > ran under 20 fps in fullscreen mode, but about 34 fps in windowed
> > mode. I can understand that the drop is relatively huge from 30 to
> > under 20 because it has to vsync, but not why the windowed version
> > runs faster.
>
> hmm, perhaps the windowed version is using a faster display depth than
> fullscreen? the windowed mode is 16bit, while the fullscreen is 32bit?
> usually this is the other way around though, since the fullscreen mode
> can run at any depth, and the windowed mode is forced to match the
> desktop depth.
>
> try running fullscreen without the HWSURFACE and DOUBLEBUF flags? this
> will probably run slower for both windowed and fullscreen, but i'm
> wondering how the speeds will compare for that?
>
> obviously the fullscreen and windowed displays are being setup
> differently, i'm just wondering what that difference might be. you can
> get a bit of information about the display mode by doing this.
>
> print pygame.display.Info()
>
> ____________________________________
> pygame mailing list
> pygame-users@seul.org
> http://pygame.seul.org

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org