Skip to main content
gamedev.net
🔒 Locked

Embedding Spidermonkey

Started by kratolp 1 reply 1.3k views
Original Post
kratolp
kratolp
Hello everyone, I want to use spidermonkey as a scripting language in my engine. But for i can't figure the right way to register an instance of a c++ class in the engine. For example i want to do this: // C++ MyObject myObject; SpiderMonkey::getInstance()->registerObject("myObject",static_cast(myObject)); // &#106avascript myObject.doSomething(); I should have missed something but i can't figure what. Thanks in advance.
kratolp
kratolp
Ok I finally got it with the help of JS_DefineObject on a global object.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.