Wednesday, March 24, 2010

libtcod and swig - The current plan...

tbellin stepped up and figured out the swig documentation when it came to callbacks. He's tested in C# and apparently it works. I'm thrilled that somebody figured it out. :)

From reading the documentation, the given language needs "director" support for callbacks to work, so some languages like lua are out of luck for now (until SWIG adds more support) unfortuntly.

As I mentioned in the comments sections yesterday, here are my plans:
  • Get heightmap finished
  • Fix one issue with callbacks user data.
  • Port the libtcod-net demo application to the new libtcod wrapper for testing.
  • Port magecrawl to the new libtcod wrapper for more testing.
  • Release two "official" platforms
    • C# - If things work out, for the period of at least a release support both the new and old library. Strongly encourage people to move to the new wrapper.
    • LUA - While it'll have to not have support for callbacks (stupid swig director support), it's still "good enough".
  • Ask people who are interested in other languages/platforms to work with me to bring those languages up to a good enough level.

4 comments:

sr said...

As the person who wrote the mzscheme bindings to libtcod, I'm hoping this makes my code obsolete.

Is there any chance of making the swig interface file available, so I could play with the mzscheme bindings it generates? The generated bindings would be fine too, but that's likely going to distract you from stuff you'd rather be doing :)

donblas said...

It's already in svn. Point svn here:

http://doryen.eptalys.net/svn-libtcod/

it's in trunk/swig/libtcod.i

To add your language, edit these files:

trunk/CMakeLists.txt
trunk/swig/CMakeLists.txt

to add your language specific swig run. There is a pattern already you can follow.

Feel free to e-mail chris dot hamons at gmail dot com if you have any questions or when you get a patch that works.

donblas said...

Also, forgot to mention that you need to build via cmake to get these built. In the trunk/cmake directories, there are some scripts that make building the "projects" easy, generate-vc.bat and generate-make.sh. If you need another build system, take a look how they work, it's really simple.

donblas said...

One more thing I forgot, jice comitted a big change that changed all the print function:

http://doryen.eptalys.net/forum/index.php?topic=499.0

This might mean if you sync down code tonight, it might not completely work right now (or look nice), I'll take a look tonight.