jsbindings versus cxx-generator

I’ve been digging a bit into cxx-generator versus jsbindings (https://github.com/zynga/jsbindings) and have a couple questions:

  • Is the jsbindings repository only meant to be used with cocos2d-iphone?

  • Is there a way to generate jsbindings from an objective-c class for cocos2dx? I’m assuming you can manually write a C*+ wrapper for an objective-c class. Is there a way to auto-generate that C*+ wrapper before running it through cxx-generator? Is it necessary?

That repo is for cocos2d-iphone to generate jsbinding.
You could find the tool to create jsbinding for cocos2d-x here(https://github.com/funkaster/cxx-generator).

cxx-generator supports windows now, for more details, please refer to https://github.com/cocos2d/cocos2d-x/tree/gles20/tools/tojs.

James… https://github.com/cocos2d/cocos2d-x/tree/gles20/tools/tojs. is a 404…

I should assume that the best way to use a tojs is from the tools into the cocos2d-x folder, right?

I got that it works good in Windows thru the bat file (genbindings-win32.bat), but can I use to glue my personal code as well?

Thanks!

Sure, you could use it to generate your own glue codes. You just need to configure another .ini file.

Pedro Kayatt wrote:

James… https://github.com/cocos2d/cocos2d-x/tree/gles20/tools/tojs. is a 404…
>
I should assume that the best way to use a tojs is from the tools into the cocos2d-x folder, right?
>
I got that it works good in Windows thru the bat file (genbindings-win32.bat), but can I use to glue my personal code as well?
>
Thanks!

Hi James, in fact there is a problem when using the binding-generator in Windows (cygwin).
I couldn’t configure it to work, so I took another approach and created a working version of a test.bat (instead of test.sh) to create the bindings.

But the test.ini was giving me an error, so I have changed it a little to be more understandable.

I am trying to attach 2 files, but have been unable, I will send another reply with the test.bat.

PS: Have tried to make a pull request into the https://github.com/cocos2d/bindings-generator , but not sure why I am unable to make it work over that rep. (I think clang has changed version and there’s an auto lua binding that I was not expecting).