jeng
15-11-2007 19:21:32
Here's some proof of concept on a SIP backend code generator for Ogre Python code bindings.
The bindings include pretty much everything in OgreMain.dll minus a few things that need hand wrappers. pygccxml is used to parse the Ogre header files and a utility called "AutoSIP" that I quickly wrote generates the SIP interface files.
A few things of note:
The bindings include pretty much everything in OgreMain.dll minus a few things that need hand wrappers. pygccxml is used to parse the Ogre header files and a utility called "AutoSIP" that I quickly wrote generates the SIP interface files.
A few things of note:
1. The wrapper code is generated in less than 1 minute
2. The wrappers compile in less than 1 minute
3. There is no dependency on Boost::Python or extreme use of templates
4. The release binary is 1.6 megabytes
5. Subclassing in Python for any class which implements a virtual function is supported
6. Class operators are supported
7. SIP is used to generate the PyQT wrappers. The resultant code is very tight...
8. The wrapper code is much easier to debug at the C++ level (no obfuscated templates!)
[/list:u]
I put up the generated SIP interface file, the generated wrapper code, and a quick hacky test.py with the PyQT interface here:
DOWNLOAD SAMPLES.
The included test.py renders into a PyQT GL widget and works rather nicely... I have less than 8 hours of work into this: pygccxml + SIP really compliment one another...
Thoughts?
-JE