Page 1 of 1

Regenerating the swig binding

Posted: Sat Apr 11, 2009 6:34 am
by benob
I complemented the contact callback function of love.physics in order to get remove/persist events, but I can't figure out how to regenerate the bindings. There are no *.i files in the 0.5 source package neither in the svn. Where should I look?
Thanks.

Re: Regenerating the swig binding

Posted: Sat Apr 11, 2009 9:26 pm
by benob
I ended up hand-generated the missing binding ;)
I'm sharing the contact code with the community as it's been requested here http://love2d.org/forum/tracker.php?p=2&t=31
basically, I added a "getType()" function to contacts. The returned value is:
0 = add contact
1 = persist contact
2 = remove contact
3 = result (don't know what that is but it's provided by box2d)
next time, I'll use love.constants instead of numbers ;)

to use it, just patch the source code (patch -p1 in the main directory) with the attached patch; then when you get a contact from the callback, check it's type with c:getType().

Re: Regenerating the swig binding

Posted: Thu Apr 16, 2009 12:56 am
by benob
I'm still interested by how to regenerate swig bindings. Anyone?

Re: Regenerating the swig binding

Posted: Sat Apr 18, 2009 5:50 pm
by rude
"We" (i.e. I) decided to stop using SWIG[1], and start wrapping everything manually.

Due to certain limitations in SWIG and/or my lack of skills with this tool, I had to make a separate tool which post-processed the generated wrapper code and "injected" extra methods. It was horrible. Please don't make me find that tool and relive that nightmare. Let the SWIG binding rest in peace.

[1]: Reasons available on request.

Re: Regenerating the swig binding

Posted: Sat Apr 18, 2009 11:18 pm
by benob
Thanks, Rude. Did you drop swig prior to 0.5.0, or is it in the svn? I read a few threads about the future of love. Are your plans to bury it? Maybe you should let the community get more involved in the development, by stabilizing the svn and documenting a little bit the roadmap/how-to-contribute stuff.

Cheers for that great project.
Ben.

BTW, I'm also interested by the gory details of your hate relation with SWIG.

Re: Regenerating the swig binding

Posted: Sun Apr 19, 2009 2:00 am
by Alex
benob wrote:BTW, I'm also interested by the gory details of your hate relation with SWIG.
Me too. I've seen SWIG around, but I only just took a look at it due to this thread. It's certainly a tool that's piqued my interest, so I'd like to hear more about it.