Hi all,

Due to some limitations in the old embind class inheritance API, I have
introduced a new API.  It is merged into incoming as of
https://github.com/kripken/emscripten/pull/2371  The new API allows
JavaScript to derive from C++ classes in a Backbone.js-style way:

var JSClass = Module.CPPClass.extend("JSClass", {
    __construct: function(v) {
        this.__parent.__construct.call(this);
        this.field = v;
    },
    someMethod: function() {
        return this.field;
    }
});

var instance = new JSClass;

// instance can now be passed in and out of C++

The above is simply a rough introduction to the new syntax.  I've updated
the documentation at https://github.com/kripken/emscripten/wiki/embind and
explored a few of the trickier bits, like how embind supports implementing
non-pure virtual methods.

Let me know if you have any questions or problems!


-- 
Chad Austin
Technical Director, IMVU
http://engineering.imvu.com <http://www.imvu.com/members/Chad/>
http://chadaustin.me

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to