Sign in to follow this  
Acharis

How to disable HiDPI scaling? (problems)

Recommended Posts

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.

 

Share this post


Link to post
Share on other sites

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).

Edited by Acharis

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this