-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
When running on Android using Emscripten, the SDL window size is incorrect after rotating from landscape to portrait.
imbenji — Today at 6:21 AM
I've ran into this as well, you're going to need to get the window size differently on the web for use in your viewport. Here's what I've done in the past:
#ifdef __EMSCRIPTEN__
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = emscripten_webgl_get_current_context();
emscripten_webgl_get_drawing_buffer_size(context, width, height);
#else
SDL_GetWindowSizeInPixels(window, width, height);
#endif
VigliettaSensei — Today at 9:59 AM
Anyway, the phrasing is misleading, because it's not necessarily "after rotating from landscape to portrait". It's happening in portrait mode, period.
Also, the reported solution doesn't fix the issue on some phone models. I still don't know what's causing it and why some models work and some don't.
Also, it is critical to point out that it only occurs in high dpi mode.
VigliettaSensei — Today at 10:19 AM
And remarkably it's not only model-dependent, but also browser-dependent, with Firefox being the most reliable.