Huhu,
I tried Python with PySFML 1.6 on Windows 7 64bit with 32bit Python 2.7 but it crashes..
(In C++ i haven't any problems...)
First I tried the sample from the PySFML tutorial, this worked good.
Than I tried the samples in the SDK but it chrashed in the Worm sample when I pressed the enter/return key.
I also tried to make a simple game but it chrashes in this line:
Window.Draw( sf.String( "MenuState" , sf.Font.GetDefaultFont(), 30 ) )
Source:
from PySFML import sf
class BaseState( object ):
def Run( self, Window ):
return None
class MenuState( BaseState ):
def __init__( self ):
super( MenuState, self ).__init__()
def Run( self, Window ):
while True:
Event = sf.Event()
while Window.GetEvent(Event):
if Event.Type == sf.Event.Closed:
return GameState
Window.Clear()
Window.Draw( sf.String( "MenuState" , sf.Font.GetDefaultFont(), 30 ) )
Window.Display()
return None
class GameState( BaseState ):
def __init__( self ):
super( GameState, self ).__init__()
def Run( self, Window ):
while True:
Event = sf.Event()
while Window.GetEvent(Event):
if Event.Type == sf.Event.Closed:
return None
Window.Clear()
Window.Draw( sf.String( "GameState" , sf.Font.GetDefaultFont(), 30 ) )
Window.Display()
return None
class Game:
def Run( self ):
Window = sf.RenderWindow( sf.VideoMode( 800, 600, 32 ), "PySFMLTest", sf.Style.Close )
Window.SetFramerateLimit( 60 )
Next_State = MenuState
while Next_State is not None:
State = Next_State()
Next_State = State.Run( Window )
Main = Game()
Main.Run()
If I remove the Window.Draw(...) lines, it works...
Is the Python binding buggy?