Embind : create value_object in javascript side

336 views
Skip to first unread message

guillaume...@gmail.com

unread,
Nov 21, 2014, 5:47:42 AM11/21/14
to emscripte...@googlegroups.com
Hi all,

I have struct in C code.
I have map this struct with emscripten::value_object and I want to create the struct in javascript side.

I try with "new Module.MyStructName" but it doesn't work.
If i use class_ to map the strcut, I have no constructor error.

How can i do that ?

Chad Austin

unread,
Dec 4, 2014, 1:28:15 AM12/4/14
to emscripte...@googlegroups.com
Hi,

You ought to be able to simply write an object literal:

{ 'foo': 10, 'bar': 'abcd' }

and pass it straight into a C++ function expecting a value of that type.


--
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 emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Chad Austin
Technical Director, IMVU

Reply all
Reply to author
Forward
0 new messages