Hi,

Working on the library_webcl.js for Emscripten, I have some difficulty with 
function who take callback.

My function is : clSetEventCallback: 
function(event,command_exec_callback_type,pfn_notify,user_data) { ... }

Where pfn_notify is the pointer function.

For do that I create a callback variable inside the js function.

*    var _callback = null*
*    if (pfn_notify != 0) {*
*      _callback = function() { *
*        console.info("\nCall callback function : 
FUNCTION_TABLE["+pfn_notify+"]("+event+", "+command_exec_callback_type+" , 
"+user_data+")");*
*        FUNCTION_TABLE[pfn_notify](event, command_exec_callback_type , 
user_data); *
*      };*
*    }*

And after that I call the WebCl function passing the callback variable : 

*  CL.cl_objects[event].setCallback(command_exec_callback_type,_callback);*

The complete call result give : 

*[Log]  (SetEventCallBack.js, line 5624)*
*clSetEventCallback(991646,0,636,0)*
* ->[object WebCLEvent].setCallback(0,function () { *
*          console.info("\nCall callback function : 
FUNCTION_TABLE["+pfn_notify+"]("+event+", "+command_exec_callback_type+" , 
"+user_data+")");*
*          FUNCTION_TABLE[pfn_notify](event, command_exec_callback_type , 
user_data); *
*        })*
* =>Result (0) - Message () - Exception ()*


My problem is the console info is correctly call, inside the console I have 
: 

*Call callback function : FUNCTION_TABLE[636](991646, 0 , 0)*

But the printf inside the function callback in the c++ part is never 
printed.

May be I misunderstand something, so any idea how i must do ??

Tony


-- 
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/groups/opt_out.

Reply via email to