SDL window's High DPI flags adds support for modern desktop compositors that implement fractional desktop scaling by means of "virtual desktop resolution" that may be different than opengl context resolution.
Using desktop scaling is the best method for ui scaling in jk2mv (console text). Previous method of using display DPI is worse because it doesn't take into account distance from which user is looking at the monitor or personal preferences.
Moreover these new desktop compositors will provide virtual desktop resolution as real resolution for legacy applications and stretch the image by desktop scaling factor, resulting in blurry picture. This is what happens with jk2mv on macos/wayland currently - on a 4k display with desktop scaling 200% jk2mv is rendered at 1080p and stretched to fit the display.
There is only one more thing that still doesn't work before it can be merged, afaik.
Fullscreen window with non-native resolution doesn't work properly. It maybe be due to lack of support in SDL for this case, or maybe we are setting window display resolution wrong.
Because of this, the pull request is not ready to merge. I'm writing all this down in case I forget about it and/or someone wants to finish it in the future. Or perhaps SDL implementation becomes better in new release and it starts working.
SDL's Wayland videodriver doesn't seem to implement high dpi window with opengl context correctly in latest version so it's disabled for now (it has more problems like missing window decorations anyway, so it's rather experimental for now)
SDL window's High DPI flags adds support for modern desktop compositors that implement fractional desktop scaling by means of "virtual desktop resolution" that may be different than opengl context resolution.
Using desktop scaling is the best method for ui scaling in jk2mv (console text). Previous method of using display DPI is worse because it doesn't take into account distance from which user is looking at the monitor or personal preferences.
Moreover these new desktop compositors will provide virtual desktop resolution as real resolution for legacy applications and stretch the image by desktop scaling factor, resulting in blurry picture. This is what happens with jk2mv on macos/wayland currently - on a 4k display with desktop scaling 200% jk2mv is rendered at 1080p and stretched to fit the display.
There is only one more thing that still doesn't work before it can be merged, afaik. Fullscreen window with non-native resolution doesn't work properly. It maybe be due to lack of support in SDL for this case, or maybe we are setting window display resolution wrong.
Because of this, the pull request is not ready to merge. I'm writing all this down in case I forget about it and/or someone wants to finish it in the future. Or perhaps SDL implementation becomes better in new release and it starts working.
SDL's Wayland videodriver doesn't seem to implement high dpi window with opengl context correctly in latest version so it's disabled for now (it has more problems like missing window decorations anyway, so it's rather experimental for now)