-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event.detail is used even if is not set (like in the case of Resize event) #21091
Comments
SDL_init code: void runSDL() {
SDL_Init(SDL_INIT_VIDEO);
SDL_CreateWindowAndRenderer(512, 512, 0, &window, &renderer);
//surface = SDL_CreateRGBSurface(0, 512, 512, 32, 0, 0, 0, 0);
emscripten_set_main_loop(drawFramePixels, 0, 0); // 0, 1
} drawFramePixels only draws a surface, no event polling |
I think this is likely a duplicate of #20992? |
looks pretty similar, also related to e.detail not being a number (in my case undefined) |
OK, closing in favor of #20992, which will hopefully get fixed soon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please include the following in your bug report:
Version of emscripten/emsdk:
Please include the output
emcc -v
hereemcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.51 (c0c2ca1)
clang version 18.0.0git (https://github.com/llvm/llvm-project f2464ca317bfeeedddb7cbdea3c2c8ec487890bb)
Target: wasm32-unknown-emscripten
Thread model: posix
Build command line:
emcc --bind --profiling -g -sASSERTIONS=2
-sSHARED_MEMORY
-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1
-L/J/FFMPEG_SRC/FFmpeg/testcpp/libs/ffmpeg/lib
-I/J/FFMPEG_SRC/FFmpeg/testcpp/libs/ffmpeg/include
-s EXPORTED_RUNTIME_METHODS="[FS, cwrap, ccall, getValue, setValue, writeAsciiToMemory, run]"
-lx264 -lx265 -lvpx -lmp3lame -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lopus -lz -lwebp -lfreetype -lfribidi -lharfbuzz -lass -lzimg -lm
-lavcodec -lavfilter -lavformat -lavutil -lswresample -lswscale
-Wno-deprecated-declarations
-sWASM_BIGINT
-sUSE_SDL=2
-sINITIAL_MEMORY=32MB -sALLOW_MEMORY_GROWTH
-s USE_PTHREADS=1 -sPTHREAD_POOL_SIZE=4 -sPTHREAD_POOL_SIZE_STRICT=2 -sSTACK_OVERFLOW_CHECK=2
-o www/mp4info.js
mp4info-wrapper.cpp
** The Issue **
I'm using SDL2 to output a frame to a texture.
Now it seems like emscripten checks events with Event.detail which is fine for MouseEvents and other usual events.
But if you resize the window it will trigger the function with a Event that doesn't have a detail member causing an error a detail is undefined:
** Callstack **
** UIEventHandlerFunc **
** Handler func **
The text was updated successfully, but these errors were encountered: