Bat2k
24-04-2010 07:35:18
Hi,
I'm trying to make my single class to be a subclass of WindowListener, FrameListener and so on...
And then code like
causes
What's wrong?? I saw in wiki examples there are separate listener classes used but I just want to understand:)
If I missing some knowledge about C++/Python binding please give a reference.
Thanks.
SOLVED: I forgot to initialize base class (Ogre.WindowEventListener) by calling it's ctor from derived ctor.
I'm trying to make my single class to be a subclass of WindowListener, FrameListener and so on...
class TestApp(Ogre.WindowEventListener):
...
And then code like
def createWindow(self):
self.root.initialise(True, 'TestApp')
self.render_window = self.root.getAutoCreatedWindow()
assert isinstance(self.render_window, Ogre.RenderWindow)
self.render_window.addListener(self)
causes
Boost.Python.ArgumentError: Python argument types in
RenderWindow.addListener(RenderWindow, TestApp)
did not match C++ signature:
addListener(RenderWindow_wrapper {lvalue}, Ogre::RenderTargetListener* listener)
addListener(Ogre::RenderWindow {lvalue}, Ogre::RenderTargetListener* listener)
File "/home/bat/devel/sandbox/src/test_app/test_app.py", line 67, in <module>
main()
File "/home/bat/devel/sandbox/src/test_app/test_app.py", line 63, in main
app = TestApp()
File "/home/bat/devel/sandbox/src/test_app/test_app.py", line 14, in __init__
self.createWindow()
File "/home/bat/devel/sandbox/src/test_app/test_app.py", line 30, in createWindow
self.render_window.addListener(self)
What's wrong?? I saw in wiki examples there are separate listener classes used but I just want to understand:)
If I missing some knowledge about C++/Python binding please give a reference.
Thanks.
SOLVED: I forgot to initialize base class (Ogre.WindowEventListener) by calling it's ctor from derived ctor.