How to disable HiDPI scaling? (problems)

Started by
0 comments, last by Acharis 8 years ago

I have a problem with Win 8.1 (some machines only), with the HiDPI scaling. I'm unable to disable it (properly).

I tried to use SDL_HINT_VIDEO_HIGHDPI_DISABLED but it either seem to not work or work partially (like in some resolutions it does not work? or the screen in borderless looking quite poor (depends on SLD version, in some it just do not work)).

Whenever I manually check "Disable HiDPI scaling" on the .exe file's comatibility tab it works flawlessly.

Is there a way to do it exaclty as if you checked the compatibility tab option? The solution does not need to be via SDL2, can be by other means as long as I can use it with SDL.

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

Advertisement

I have downloaded the newest SDL 2.0.4 from the official site just a moment ago. Both linked & compiled version report as 2.0.4 (so I assume I have no outdated libraries, except SDL_ttf etc but these are irrelevant).

Here is the code (as you see I went quite paranoid here :D):


if(SDL_SetHintWithPriority(SDL_HINT_VIDEO_HIGHDPI_DISABLED,"1",SDL_HINT_OVERRIDE)==SDL_TRUE) Debug("SDL_HINT_VIDEO_HIGHDPI_DISABLED = 1\n"); else Debug("SDL_HINT_VIDEO_HIGHDPI_DISABLED  failed!\n");
Debug("SDL_HINT_VIDEO_HIGHDPI_DISABLED=%s\n",SDL_GetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED));

if(enableaudio) {if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0 ) return 0;}
else {if(SDL_Init(SDL_INIT_VIDEO) < 0 ) return 0;}

if(SDL_SetHintWithPriority(SDL_HINT_VIDEO_HIGHDPI_DISABLED,"1",SDL_HINT_OVERRIDE)==SDL_TRUE) Debug("SDL_HINT_VIDEO_HIGHDPI_DISABLED = 1\n"); else Debug("SDL_HINT_VIDEO_HIGHDPI_DISABLED  failed!\n");
Debug("SDL_HINT_VIDEO_HIGHDPI_DISABLED=%s\n",SDL_GetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED));

All of those hint functions return "1"...

Still not working (the only difference is that in window borderless mode the screen works OK but looks totally ugly, under SDL 2.0.1 it was not working).

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

This topic is closed to new replies.

Advertisement