Windows:
As slime has said in several threads, Löve on Windows still doesn't support High DPI modes on Windows because SDL doesn't yet support it (groan). The result is that love.window.getDesktopDimensions() returns virtual units on Windows (using Löve 11.3). For example, on a 3840x2160 screen running with 200 % Windows screen scaling, love.window.getDesktopDimensions() returns 1920x1080. The only workaround I've found is to set the Löve executable to be High-DPI-aware in a .bat file:
Code: Select all
setlocal
pushd %~dp0\
set __COMPAT_LAYER=~ HIGHDPIAWARE
love.exe game.love
popd
endlocal
macOS:
But I also haven't found a good way to get the real pixel size of the desktop on macOS. On a 3840x2160 screen running in Retina mode, love.window.getDesktopDimensions() always returns 1920x1080 regardless of whether conf.lua -> t.window.highdpi is true or false. I'd like to use this configuration:
Code: Select all
t.window.width = 1200
t.window.height = 700
t.window.highdpi = true
t.window.usedpiscale = false
(Also, it seems like a bug that when using the above configuration, the created window is 2400x1400 pixels large. It should be 1200x700 because t.window.usedpiscale is set to false.)
The only way to get the real desktop size on macOS seems to be using this configuration:
Code: Select all
t.window.highdpi = true
t.window.usedpiscale = true
Suggestion:
- Add a love.window.getDesktopPixelDimensions() API. Maybe query a Windows (macOS/other OS) API directly if SDL is still not there yet.
- When using the configuration with t.window.usedpiscale = false mentioned above, I think the window size should be 1200x700 pixels, not 2400x1400, on a macOS Retina screen.