my guess : it is because vec2 template preprocessed to C array. On Friday, March 7, 2014 1:15:44 PM UTC+2, Michael IV wrote: > > I have a template class vec2 (GLM math lib) .To expose it to JavaScript > I first tried value_array.Works great. > But then I wanted to have more object oriented interface so that at > JavaScript side we can do: > > var vector = Module.glm_add(vec1,vec2); > > vector.x; > vector.y; > .... > So I tried value_object which compiles ok but in JS I am getting blank > screen. > > EMSCRIPTEN_BINDINGS(my_module) { > /* > //this works > value_array<vec2>("vec2") > .element(&vec2::x) > .element(&vec2::y) > ; > */ > //this doesn't > value_object<vec2>("vec2") > .field("x", &vec2::x) > .field("y", &vec2::y) > ; > function("glm_add", &glm_add); > } >
-- 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-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.