I am working on merging DirectPython for my sound and input with Pyogre for my rendering and GUI. What I'm currently having trouble with is getting the HWND of the OGRE render window so that I can pass this as the focus window for the input watching. If there are any ideas it would be appreciated, as I'd really rather not find another input library.
What version of pyOgre are you using?. Version 1.2.0 was updated to include retrieval of CustomAttributes from a RenderTarget. This was only really tested using an older version of OIS on windows but hopefully should work.
if sys.platform == 'win32':
hwnd = self.renderWindow.getIntCustomAttribute("HWND")
hwnd = self.renderWindow.getIntCustomAttribute('GLXWINDOW')
raise Exception, 'Platform not supported'
print "Window Handle Value is", hwnd
I'm currently using 1.0.5 Azathoth release. I'll download the latest version and see if the GetIntCustomAttribute call is in there, as this version only has GetCustomAttribute, which wants a c/c++ pointer as a second argument, so I don't know exactly how to extract the handle with it. Thanks for the help.
According to BerliOS, I have the most recent version of the pyogre binaries. Seeing as I have never compiled pyogre from source, does anyone know if there is a way to use the older call, getCustomAttribute, to get this information? Any help is much appreciated... or a link to a Dagon pyogre port.
Thanks for the fast responses, 1.2.0 and the getIntCustomAttribute worked great. Time to start porting from my PyOgre/PyGame hybrid to the new PyOgre/DirectPy setup.