Regenerating the swig binding

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
benob
Prole
Posts: 6
Joined: Sat Apr 11, 2009 6:28 am

Regenerating the swig binding

Post 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.
benob
Prole
Posts: 6
Joined: Sat Apr 11, 2009 6:28 am

Re: Regenerating the swig binding

Post 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().
Attachments
love-0.5-0_contact.patch.gz
patch for getting persist/delete callbacks for contacts
(1.75 KiB) Downloaded 238 times
benob
Prole
Posts: 6
Joined: Sat Apr 11, 2009 6:28 am

Re: Regenerating the swig binding

Post by benob »

I'm still interested by how to regenerate swig bindings. Anyone?
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Regenerating the swig binding

Post 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.
benob
Prole
Posts: 6
Joined: Sat Apr 11, 2009 6:28 am

Re: Regenerating the swig binding

Post 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.
Alex
Prole
Posts: 30
Joined: Mon Mar 09, 2009 1:49 pm

Re: Regenerating the swig binding

Post 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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 227 guests