--- a/src/MacSrc/ShockBitmap.c +++ b/src/MacSrc/ShockBitmap.c @@ -42,11 +42,26 @@ SDL_RenderClear(renderer); +#ifndef __ANDROID__ + // On Android there's exactly one OS-controlled-size surface - no + // desktop-style window to resize, move, or toggle fullscreen on. + // SDL_SetWindowSize() still "succeeds" there (Android has no + // SetWindowSize driver hook, so SDL's generic layer just overwrites its + // own cached window->w/h to the requested game resolution, e.g. + // 640x480, and synthesizes a resize event from that) - which desyncs + // SDL's own notion of the window size from the real, unchanged Android + // surface size (e.g. 1600x1200), and that desync is exactly what then + // makes both SDL's internal renderer viewport and this engine's own + // custom GL viewport (OpenGL.cc's opengl_resize(), driven by that same + // now-wrong cached size) shrink to the game's resolution instead of + // filling the real surface. Skip the desktop-only calls on Android + // entirely, leaving SDL's window-size bookkeeping untouched. extern bool fullscreenActive; SDL_SetWindowFullscreen(window, fullscreenActive ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); SDL_SetWindowSize(window, width, height); SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); +#endif SDL_RenderSetLogicalSize(renderer, width, height);