Page 1 of 1

Windows global scale

Posted: Sat Dec 26, 2020 2:39 pm
by darkfrei
Hi all!

I have problem. I have windows 10 and I have 150% scale for 4K monitor.
Image

How to set the Löve window scale back to 100%?

For example I've made the window 800x600, but the screenshot will be taken with 1200x900.

How to set another (for example 100%) window scaling by custom Windows10 scale? I want my sharp pixels back.

Re: Windows global scale

Posted: Wed Dec 30, 2020 12:54 pm
by Pienkaito
Perhaps you could disable dpi scaling on love.conf?

Code: Select all

function love.conf(t)
	t.window.usedpiscale = false
end

Re: Windows global scale

Posted: Wed Dec 30, 2020 1:59 pm
by darkfrei
Pienkaito wrote: Wed Dec 30, 2020 12:54 pm Perhaps you could disable dpi scaling on love.conf?

Code: Select all

function love.conf(t)
	t.window.usedpiscale = false
end
Thanks for reply!

But it seems don't work as expected.

Re: Windows global scale

Posted: Thu Dec 31, 2020 12:24 am
by pgimeno
I think usedpiscale is about Android, and highdpi is about Windows and MacOS.

Re: Windows global scale

Posted: Thu Dec 31, 2020 12:34 am
by slime
The highdpi flag is supported on macOS, iOS, and I believe on Linux if Wayland is used. On Android it's effectively always enabled.

On Windows, unfortunately SDL doesn't support it yet. What that means is the OS doesn't treat the app as being aware of DPI scaling, so Windows will scale the final output of the app up automatically (without letting the app know it's doing so) when the user's DPI scale is >100%.

The usedpiscale flag applies any time the highdpi flag is enabled (macOS/iOS/Android/Wayland - not Windows though) - when it's on (the default), love automatically applies DPI scaling to most units as long as highdpi is enabled and supported as well. When you turn it off, you're basically promising your code is written to manually scale things correctly.

If you want to make Windows not apply its own DPI scaling to love, there are some DPI scaling options provided by Microsoft in the Compatibility section of the exe Properties menu available if you right click an exe. If you turn Windows' automatic DPI scaling off you still won't be able to get the real DPI scale for applying correct scaling (for positioning and sizing) yourself in code though.