emscripten: Do not use SDL_WINDOW_HIGH_PIXEL_DENSITY in SDL3

The web shell scales the canvas to its final display size.  Enabling a
high-density backbuffer would make SDL scale to device pixels first,
followed by another scaling pass in the browser.
This commit is contained in:
kichikuou
2026-09-17 08:59:13 +09:00
parent 981c302dfc
commit 461673bec7
+4 -2
View File
@@ -372,8 +372,10 @@ inline SDL_Window* CreateWindow(const char* title, int width, int height,
scale = 1.0f;
width = static_cast<int>(width * scale + 0.5f);
height = static_cast<int>(height * scale + 0.5f);
return SDL_CreateWindow(title, width, height,
flags | SDL_WINDOW_HIGH_PIXEL_DENSITY);
#ifndef __EMSCRIPTEN__
flags |= SDL_WINDOW_HIGH_PIXEL_DENSITY;
#endif
return SDL_CreateWindow(title, width, height, flags);
#endif
}