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

Re: [pygame] PyGame crash upon set_mode



Jeffrey Drake wrote:

> I added in everything else after (the other display.* lines), the 
> original line was display.set_mode. It crashes if I give it any flags. 
> It doesn't crash if   I don't pass any flags. I am perplexed by this. 
> Any help would be appreciated.

>   surface = display.set_mode((640, 480), vi.bitsize, FULLSCREEN)

hmm, does this crash with "any" flags, or only the FULLSCREEN one?
try something harmless like "ANYFORMAT" ?

what platform is this running on? and which SDL display driver are you 
using? (if not the default).

i can't really think what would be crashing here, perhaps there is an 
odd refcount bug in the Info object? try passing any arbitrary depth as 
the bitsite, like 16 or 32.


you might also want to know that SDL is very accomodating when setting 
the display mode. even if the display cannot do fullscreen 640x480 it 
will find the closest match and put a black border around a 640x480 area.

your code to find the correct bit depth and check for a correct screen 
mode is not really needed. the call could be reduced to this..

surface = display.set_mode((640,480), 0, FULLSCREEN)

perhaps wrap it in a "try: except pygame.error:" block? passing 0 for 
the bit depth just chooses the "natural" depth.

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