Choosing the correct wrapping method?

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
cypher543
Posts: 78
Joined: Sat Apr 15, 2006 5:24 pm
Location: Missouri, USA
Contact:

Choosing the correct wrapping method?

Post by cypher543 »

Ok, I'm working on a new Linux FPS, but my C++ skills aren't all that great. I love Python, though. But, I can't decide which path to take...

[1] Use SWIG to write Irrlicht code in Python
[2] Write the game in C++ and use SWIG to make Python the scripting language

Either way, I must have a scripting engine. [2] would be the easiest for this. But, like I said, my C++ skills are crap. [1] is the easiest for the actual game programming, but I would have to write my own interpreter and VM for the scripting (I'm assuming I can't use SWIG to expose Python functions to Ruby/Lua).

So, which path should I take? (please don't try and suggest any languages other than C++ or Python)
stodge
Posts: 216
Joined: Fri Dec 05, 2003 5:57 pm

Post by stodge »

Use Lua. No just kidding!

The optimal solution would be to write the "main loop" in C++ for speed, and the game logic in Python. Writing Python bindings for Irrlicht is a lot of work, and is probably a waste of time. Create game related objects in C++ and write bindings for those. If you want to see how much work is involved in writing bindings for Irrlicht, look at PyOGRE, the Python bindings for OGRE3D. It's a lot of work....
pinballwizard
Posts: 67
Joined: Wed Aug 02, 2006 1:47 am

Re: Choosing the correct wrapping method?

Post by pinballwizard »

cypher543 wrote:Ok, I'm working on a new Linux FPS, but my C++ skills aren't all that great. I love Python, though.
There is Venom, the Python "binding" for Irrlicht. It's actually not a 1-to-1 API binding but is instead a kind of higher-level C++ framework that exposes some functions to Python. It's not supported anymore, but it seemed to work well last time I looked. Search the forum for more info.

The other possibility is to use Jython, which is a Python interpreter written in Java, and make calls to Jirr, the Java binding for Irrlicht. I basically got this to work (except for some Jirr glitches on Linux), so it's doable, but it may be slow because of the 2 language layers involved (Jython-to-Java and Java-to-C++).
Post Reply