Repository navigation
Conversation
Without SDL_WINDOW_HIGH_PIXEL_DENSITY, SDL3 gives the window a 1x backing store on macOS, so Retina displays upscale the whole frame (game, filters and F8 menu) and it looks blurry. Presentation already sizes itself from pixel dimensions (render output / GPU swapchain), so opt in on Apple. Also draw the asset-bootstrap splash and level-editor toast in render output pixels instead of logical window size, and log window points vs pixels at startup to make DPI issues easy to diagnose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On macOS the whole window is blurry on Retina displays: the game image, the CRT/LCD filters and the F8 ImGui menu.
SDL3 only gives a window a full-resolution backing store when it's created with
SDL_WINDOW_HIGH_PIXEL_DENSITY. Neither window-creation path set it, so the window got a 1x backing store and macOS upscaled every frame 2x.Fix
port/port_main.c: addSDL_WINDOW_HIGH_PIXEL_DENSITYto both theSDL_CreateWindow(GPU) andSDL_CreateWindowAndRenderer(software) paths, limited to__APPLE__. The present code already sizes itself from pixel dimensions (SDL_GetCurrentRenderOutputSize/ swapchain size), so nothing else in the main render path needs to change.port/port_asset_bootstrap.cpp: the first-launch asset-extraction splash now draws in render-output pixels. With HiDPI on, the logical window size would only fill the top-left quarter.port/port_imgui_menu.cpp: same fix for the level-editor toast.[window] WxH points, WxH pixels (density N), which makes DPI problems easy to spot in bug reports.Testing
Apple Silicon MacBook (built-in Liquid Retina display), USA ROM,
python3 build.py --usa, Metal backend (backend=metal, shader=MSL):The image and the F8 menu are now sharp. Not tested on Intel Macs, Windows or Linux. Those platforms are unchanged except for the new log line.
🤖 Generated with Claude Code