You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build returns lots of these warnings, which means that this functionality can't be used as it is.
DotnetRaylibWasm
WasmApp.Native.targets(292, 5): [WASM0001] Could not get pinvoke, or callbacks for method 'Raylib_cs.Raylib::SetTraceLogCallback' because 'Parsing function pointer types in signatures is not supported.'
WasmApp.Native.targets(292, 5): [WASM0001] Could not get pinvoke, or callbacks for method 'Raylib_cs.Raylib::SetLoadFileDataCallback' because 'Parsing function pointer types in signatures is not supported.'
WasmApp.Native.targets(292, 5): [WASM0001] Could not get pinvoke, or callbacks for method 'Raylib_cs.Raylib::SetSaveFileDataCallback' because 'Parsing function pointer types in signatures is not supported.'
WasmApp.Native.targets(292, 5): [WASM0001] Could not get pinvoke, or callbacks for method 'Raylib_cs.Raylib::SetLoadFileTextCallback' because 'Parsing function pointer types in signatures is not supported.'
WasmApp.Native.targets(292, 5): [WASM0001] Could not get pinvoke, or callbacks for method 'Raylib_cs.Raylib::SetSaveFileTextCallback' because 'Parsing function pointer types in signatures is not supported.'
WasmApp.Native.targets(292, 5): [WASM0001] Could not get pinvoke, or callbacks for method 'Raylib_cs.Raylib::SetAudioStreamCallback' because 'Parsing function pointer types in signatures is not supported.'
WasmApp.Native.targets(292, 5): [WASM0001] Could not get pinvoke, or callbacks for method 'Raylib_cs.Raylib::AttachAudioStreamProcessor' because 'Parsing function pointer types in signatures is not supported.'
WasmApp.Native.targets(292, 5): [WASM0001] Could not get pinvoke, or callbacks for method 'Raylib_cs.Raylib::DetachAudioStreamProcessor' because 'Parsing function pointer types in signatures is not supported.'
WasmApp.Native.targets(292, 5): [WASM0001] Skipping pinvoke 'Raylib_cs.Raylib::AttachAudioStreamProcessor' because 'Parsing function pointer types in signatures is not supported.'.
WasmApp.Native.targets(292, 5): [WASM0001] Skipping pinvoke 'Raylib_cs.Raylib::DetachAudioStreamProcessor' because 'Parsing function pointer types in signatures is not supported.'.
WasmApp.Native.targets(292, 5): [WASM0001] Skipping pinvoke 'Raylib_cs.Raylib::SetAudioStreamCallback' because 'Parsing function pointer types in signatures is not supported.'.
WasmApp.Native.targets(292, 5): [WASM0001] Skipping pinvoke 'Raylib_cs.Raylib::SetLoadFileDataCallback' because 'Parsing function pointer types in signatures is not supported.'.
WasmApp.Native.targets(292, 5): [WASM0001] Skipping pinvoke 'Raylib_cs.Raylib::SetLoadFileTextCallback' because 'Parsing function pointer types in signatures is not supported.'.
WasmApp.Native.targets(292, 5): [WASM0001] Skipping pinvoke 'Raylib_cs.Raylib::SetSaveFileDataCallback' because 'Parsing function pointer types in signatures is not supported.'.
WasmApp.Native.targets(292, 5): [WASM0001] Skipping pinvoke 'Raylib_cs.Raylib::SetSaveFileTextCallback' because 'Parsing function pointer types in signatures is not supported.'.
WasmApp.Native.targets(292, 5): [WASM0001] Skipping pinvoke 'Raylib_cs.Raylib::SetTraceLogCallback' because 'Parsing function pointer types in signatures is not supported.'.
The text was updated successfully, but these errors were encountered:
It might be possible to get this to work by using the previous approach we used for callbacks though not ideal. Do you know any details about why this is not supported?
I think this example shows the complete workaround that works for me.
The main idea is to wrap method address into the unmanaged delegate and then cast to IntPtr:
// emscripten_wrap.c: Native lib with callback propagation, actually wrapper over statically linked emscriptent// to be able to use it with [DllImport]// See https://github.com/dotnet/runtime/discussions/81991#discussioncomment-5009635#include<emscripten.h>EMSCRIPTEN_KEEPALIVEvoidcall_emscripten_set_main_loop(em_callback_funcfunc, intfps, intsimulate_infinite_loop)
{
emscripten_set_main_loop(func, fps, simulate_infinite_loop);
}
// Bindings, note the IntPtr pointer type herepublicclassEmscripten{[DllImport("emscripten_wrap", CallingConvention = CallingConvention.Cdecl)]publicstaticexternunsafevoidcall_emscripten_set_main_loop(IntPtrcallback,intfps,intsimulateInfiniteLoop);}
P.S. Thank you for this titanic work with bringing Raylib-cs to the WASM environment, I'm also stepping through this road and your examples saved me really a huge amount of time!
The build returns lots of these warnings, which means that this functionality can't be used as it is.
The text was updated successfully, but these errors were encountered: