From 461673bec729e7e0ec905921fc3e03aecf977a70 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Thu, 17 Sep 2026 08:59:13 +0900 Subject: [PATCH] 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. --- src/sdl_compat.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sdl_compat.h b/src/sdl_compat.h index 025ee80..1cc1583 100644 --- a/src/sdl_compat.h +++ b/src/sdl_compat.h @@ -372,8 +372,10 @@ inline SDL_Window* CreateWindow(const char* title, int width, int height, scale = 1.0f; width = static_cast(width * scale + 0.5f); height = static_cast(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 }