Srekel
06-11-2005 01:43:40
I've started working on a game framework (which I'll probably talk more about if it becomes something of it) written in Python, of course, and I need to not use the framelistener way of doing things.
The idea is that the application will create an instance of OGREGraphicsWrapper, which creates the ogre root, the scenemanager and all that stuff.
Then the application runs OGREGraphicsWrapper.update() each frame, and the update function basically just does root.renderOneFrame() or something, and then when the application wants to end, it calls OGREGraphicsWrapper.die().
The question is: what needs to be in die()?
This is what it looks like now...
...but when I run the application in fullscreen, I get a python error (one of those basic popus) when it quits.
The idea is that the application will create an instance of OGREGraphicsWrapper, which creates the ogre root, the scenemanager and all that stuff.
Then the application runs OGREGraphicsWrapper.update() each frame, and the update function basically just does root.renderOneFrame() or something, and then when the application wants to end, it calls OGREGraphicsWrapper.die().
The question is: what needs to be in die()?
This is what it looks like now...
def die(self):
"""
Called when the game is over.
This should be overridden, but System.die(self) should be the first thing that is called.
"""
System.die(self)
"Clear variables, this should not actually be needed."
del self.camera
del self.sceneManager
del self.root
del self.renderWindow
...but when I run the application in fullscreen, I get a python error (one of those basic popus) when it quits.