Cvar_RegisterCallback(&vid_mouse_clickthrough, VID_SetHints_c);
Cvar_RegisterCallback(&vid_minimize_on_focus_loss, VID_SetHints_c);
+ // DPI scaling prevents use of the native resolution, causing blurry rendering
+ // and/or mouse cursor problems and/or incorrect render area, so we need to opt-out.
+ // Must be set before first SDL_INIT_VIDEO. Documented in SDL_hints.h.
+#ifdef WIN32
+ // make SDL coordinates == hardware pixels
+ SDL_SetHint(SDL_HINT_WINDOWS_DPI_SCALING, "0");
+ // use best available awareness mode
+ SDL_SetHint(SDL_HINT_WINDOWS_DPI_AWARENESS, "permonitorv2");
+#endif
+
if (SDL_Init(SDL_INIT_VIDEO) < 0)
Sys_Error ("Failed to init SDL video subsystem: %s", SDL_GetError());
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0)
#endif
}
- // DPI scaling prevents use of the native resolution, causing blurry rendering
- // and/or mouse cursor problems, so we need to opt-out.
-#ifdef WIN32
- SDL_SetHint(SDL_HINT_WINDOWS_DPI_AWARENESS, "1");
-#endif
-
VID_SetHints_c(NULL);
SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);