Browser platform support#848
Conversation
it'd probably also need porting to 64-bit wasm before merging as was mentioned in the forum thread, but really, amazing work on this 🎉 |
| #ifdef __EMSCRIPTEN__ | ||
| SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); | ||
| SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); | ||
| SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0); | ||
| #else |
There was a problem hiding this comment.
this should probably be done by forcing gles2 on browser, rather than #ifdef-ing the version, that way if GLES3 support is ever added to the opengl3 backend (as a delta touch backport possibly?), webgl2 can be used with full user shader support
There was a problem hiding this comment.
GL context creation is deep in js module guts generated by emscripten. So it's better to set it from "native" code.
There was a problem hiding this comment.
GL context creation is deep in js module guts generated by emscripten. So it's better to set it from "native" code.
yeah, but the ifdef'd out code already sets 2.0.0 for GLES in the very same function, that's what i'm confused about
There was a problem hiding this comment.
To be honest I just didn't want to search SDL_GL_* attribute which is not supported and ruins context creation, later I will try hunt it.
|
|
||
| # Non-Windows version also needs SDL except native OS X backend | ||
| if( NOT APPLE OR NOT OSX_COCOA_BACKEND ) | ||
| if( NOT APPLE OR NOT OSX_COCOA_BACKEND AND NOT EMSCRIPTEN ) |
There was a problem hiding this comment.
the logic itself might not need it, but it'd be good for parenthesis to be used (since mixing OR and AND)
|
also this: https://github.com/UZDoom/UZDoom/blob/trunk/src/common/audio/sound/oalsound.cpp#L639-L643 probably needs an ifdef to check for the emscripten version of openalsoft, or else a bogus warning will be printed |
It's better to check if AL_VENDOR == "Emscripten" |
a91d00d to
3e8c7f2
Compare
yeah, just something so that this warning doesn't print |
Certain things won't work without OpenAL Soft features, like sounds that use loop points (which don't cover the whole sound) or use stereo sound for 3D/world sounds, and "area sounds" may not sound correct. Some warning that the audio may sound wrong may be appropriate. |
…dd flto optimisation
afaik emscripten supports a ton of openal features |
|
yep, loop points, spatial sounds, hrtf, etc |
Thanks for opening this PR! We'll review it soon.I'm a bot that checks for some common problems. I'll update this comment with anything I find. Looks like it's your first time contributing!
Here are some minor issues, that might need fixing:
|
|
not sure if its just me but i get a lot of weird mouse snapping with this, would be cool if it was fixed before merging. 2026-01-03.23-09-44.9MB.mp4 |
Description
Adds wasm32 platform support. By default works in 32-bit mode with single thread.
Demo: https://turch.in/uzdoom+ashes2063/index.html?lang=en
Right now it's more PoC for discussion than PR ready to merge.
TODOs:
Checklist