Hi guys

I need to pass an array of floating point numbers from a JavaScript library
to a C callback, so that the latter can fill the array with data. I'm using
Runtime.getFuncWrapper to be able to call the C callback from JavaScript.

How do I pass an array to the C callback, so that it appears as a writeable
array of floats to the latter?

I've created a gist of an Emscripten-generated HTML page, to demonstrate
the scenario: https://gist.github.com/aknuds1/fd6348ab32583dea8b4a. It
shows what I've tried so far, the problem being that the data written to
the array by the C function doesn't make it back to the calling JavaScript
function. Compile the gist into an HTML page like so:

    emcc --js-library library.js -o tst.html tst.cpp.

The JavaScript function is called 'initialize', while the C callback is
called 'callback'. Let me know if anything is unclear.

Thanks,
Arve

-- 
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.

Reply via email to