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

[pygame] Re: [Civil-devel]Civil win32



On Mon, 22 Jan 2001, Kalle Svensson wrote:

>Problem summary:  civil (http://civil.sourceforge.net/) dies with a
>segfault when run on windows, thusly:
>
>Fatal Python Error: Segmentation Fault
>
>abnormal program termination
>
>I've narrowed it down to this:
>
>import pygame.display
>import pygame.image
>pygame.display.init()
>gfx = "c:/kalle/civil/civil/gfx/"
>surface=pygame.image.load(gfx+"butt-new-game-moff.png").convert()
>
>Ideas?  butt-new-game-moff.png can be found on

Running it "as is" should give you:

07:48 balrog(python)> python test.py
Traceback (most recent call last):
  File "test.py", line 5, in ?
    surface=pygame.image.load(gfx+"butt-new-game-moff.png").convert()
pygame.error: No video mode has been set

Which means that a video mode must be set first. I altered the script a
bit and added the lines:

pygame.init ()
pygame.display.set_mode ( [ 640, 480 ], 0, 24 )

and removed the other init() line. This works, and should IMHO not give a
seg fault. It should flash up a black window and then exit normally.
Weird. I don't have access to any any Windows box, so I can't test it, I'm
(un)fortunately surrounded by Linux boxes at home and work...

--------------------+--------------------------------------------------------
Jan 'Chakie' Ekholm |     Balrog New Media    http://www.balrog.fi/
   Linux Inside     | I'm the blue screen of death, nobody hears your screams

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