Hello PyOgre community,
I've started to generate Java bindings for OGRE using SWIG. Building on Windows with VC++ SWIG as a custom build option.
Now I need to generate the corresponding .i files for the OGRE project.
Has anyone already written a tool to create the interface files for Pyton or could you just send me the files you used for the Pyton bindings?
Thanks
Thanks for the qick answer, but I need either the interface files generated out of the OgreMain header files or the source code of a programm generating them. I couldn't find anything matching in the PyOgre project.
Kanma
11-10-2005 08:14:09
I'm not sure I fully understand what you mean. You are asking for the interface files (.i files) correct? They are in the subversion repository here:
http://svn.berlios.de/viewcvs/pyogre/trunk/pyogre/ogre/
Is this what you are looking for?
We didn't generate these actually, we wrote them from scratch. =)
That's exactly what I was looking for. I'll have a look at these files to write a Java application to generate all the interface files with Java bindings.
You don't want to generate the .i files automatically. The .i files are used to generate the bindings automatically but they should be written by hand. Too many things can go bad and too many glitches in Ogre need to be fixed in the .i files to generate them.
Chances are you'll spend more time trying to tweak the output to make it work for boundry cases. My recommendation is to download the pyogre .i files and modify them to #ifdef PYTHON_BUILD (or some such) around all python specific code, and add a #ifdef JAVA_BUILD around your java specifc stuff. This way you can build either by using the proper #define on the command line:
swig -DPYTHON_BUILD -python -c++ ...
swig -DJAVA_BUILD -java ...
And only use one set of .i files. If you do this then you can use our work to keep the java bindings up to date. I would accept a patch into pyogre that did the above.
But that's only a suggestion.
samlii
12-10-2005 22:00:38
Is there any talk of this getting into the main OGRE repo? It seems as if this may be a great collaborative effort to setup the bindings correctly for SWIG in general with code specific #ifdef blocks?
Tubez
12-10-2005 22:51:04
It's an add-on, and i guess this suits everyone just fine. THere is no need to burden the main CVS with it.
Is there any talk of this getting into the main OGRE repo? It seems as if this may be a great collaborative effort to setup the bindings correctly for SWIG in general with code specific #ifdef blocks?
Once upon a time (about a year ago), pyogre was in the main repository (under the addons section) and the old pyogre code still resides there. This is why I'm listed on the
developer's list. However, we decided to move away from the ogre repository when we decided to rewrite pyogre in SWIG. We *could* have deleted the code from CVS, but our reasons to move elsewhere I think are pretty sound:
- Subversion is far superior to CVS.[/*:m]
- We have more control over adding/removing access to the repository.[/*:m]
- This allows us to use patch tracking and bug tracking software provided by berliOS.[/*:m]
- We can use berliOS to release files.[/*:m]
- etc[/*:m][/list:u]
I've often expressed interest in using the SWIG wrappers for other languages, but no one has actually stepped up to do this. Fog and I will be working on python bindings only. If someone would like to build Java/Ruby/whatever bindings using pyogre it would only require them submitting a few patches to get an initial version working. Then we could talk about svn access as soon as they knew how to not break the build for python (and understood the coding standards).
Though occasionally talk comes up on the forums, no one has ever emailed me, submitted a patch, or (to my knowledge) modified pyogre to work with any other language.