mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-09-22 22:58:12 +03:00
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:
+4
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user