SDL apps, Retina displays, and DPI settings

When running in “fullscreen windowed” mode on Windows machines where the
DPI has been set above 100%, the window ends up being 150% or so as wide as
the screen. This makes the game unplayable.

Does anyone have any experience dealing with SDL games on Retina displays
or on Windows machines with high DPI settings? I would like the game to be
able to reliably create a window of the correct size regardless of the
user’s DPI settings.

(There is a workaround involving the executable’s compatibility settings,
but that requires manual effort by the user.)

Thanks,
Keith Holman
Zachtronics

There’s an issue for retina support on the SDL bugzilla, but the discussion there is mostly about implementing it for OS X: http://bugzilla.libsdl.org/show_bug.cgi?id=1934On 2013-07-18, at 3:18 PM, Keith Holman wrote:

When running in “fullscreen windowed” mode on Windows machines where the DPI has been set above 100%, the window ends up being 150% or so as wide as the screen. This makes the game unplayable.

Does anyone have any experience dealing with SDL games on Retina displays or on Windows machines with high DPI settings? I would like the game to be able to reliably create a window of the correct size regardless of the user’s DPI settings.

(There is a workaround involving the executable’s compatibility settings, but that requires manual effort by the user.)

Thanks,
Keith Holman
Zachtronics


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

That seems to be mostly about OSX, yeah, but the issue is similar on
Windows (basically you have to call a function to tell Windows the
program is DPI-aware, then Windows will stop scaling up pixels as if
they were units).

2013/7/18, Alexander Szpakowski :> There’s an issue for retina support on the SDL bugzilla, but the discussion

there is mostly about implementing it for OS X:
http://bugzilla.libsdl.org/show_bug.cgi?id=1934

On 2013-07-18, at 3:18 PM, Keith Holman wrote:

When running in “fullscreen windowed” mode on Windows machines where the
DPI has been set above 100%, the window ends up being 150% or so as wide
as the screen. This makes the game unplayable.

Does anyone have any experience dealing with SDL games on Retina displays
or on Windows machines with high DPI settings? I would like the game to be
able to reliably create a window of the correct size regardless of the
user’s DPI settings.

(There is a workaround involving the executable’s compatibility settings,
but that requires manual effort by the user.)

Thanks,
Keith Holman
Zachtronics


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

There’s an issue for retina support on the SDL bugzilla, but the
discussion there is mostly about implementing it for OS X:
http://bugzilla.libsdl.org/show_bug.cgi?id=1934

With more and more HDDPI technology foreseeable in the future, I took the
liberty of tagging this bug for 2.0.
VittorioOn Thu, Jul 18, 2013 at 8:24 PM, Alexander Szpakowski <aszpakowski at gmail.com wrote:

In case anyone else has the same problem, here is the solution to undesired
DPI scaling on Windows: You mark your program as “dpiAware” in its app
manifest.

In C# apps:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633543(v=vs.85).aspx
In native apps:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd464659(v=vs.85).aspx#step3

There is also a SetProcessDPIAware() function, but MSDN recommends using
the app manifest instead.

2013/7/19, Keith Holman :

There is also a SetProcessDPIAware() function, but MSDN recommends using
the app manifest instead.

Using SetProcessDPIAware is probably still the better idea though
because SDL wants to rely on the program settings as little as
possible. Also on MinGW it’s much easier to end up missing the
manifest.