Closed rakslice closed 3 years ago
This is only for platforms where there isn't already a platform solutions for high DPI that works with SDL2 without the application having to do anything.
A configurable setting in the graphics prefs you can change to what you want
I adopted this one (3861177).
My main PC laptop is a 13" laptop with a 4k screen, so the DPI is well into the 200s. I'm running Gnome 3 in Debian 10's default Wayland-based setup for it.
With DPI this high, a 1:1 pixel sized window is almost too small to see for a normally-sighted person and definitely not usable.
Since SDL 1.x doesn't present any kind of obvious built-in way to do pixel scaling, for previous B2/SS versions I just scripted automatically changing the Gnome resolution & DPI settings for the duration of the B2/SS run and then changing back when done (which was quite a time consuming thing to script given how littered Gnome is with dead monitor settings interfaces).
However with SDL2, pixel scaling is essentially automatic whenever the window is a different size than the bitmap graphics output, and so setting it up is just a matter of passing a different window size -- multiplying the
window_width
andwindow_height
invideo_sdl2.cpp
is a code change I can make in literally 10 seconds any time I want it -- so I haven't gotten around to seriously suggesting a change anywhereBut also I don't know what end users want for a pixel scaling feature. Some possibilities: