Windows global scale

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
darkfrei
Party member
Posts: 1169
Joined: Sat Feb 08, 2020 11:09 pm

Windows global scale

Post 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.
Attachments
2020-12-26T14_35_18-graph, universal-neural-network v.1-03 (Löve v.11.3).png
2020-12-26T14_35_18-graph, universal-neural-network v.1-03 (Löve v.11.3).png (25.8 KiB) Viewed 5670 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Pienkaito
Prole
Posts: 2
Joined: Sat Dec 26, 2020 5:53 pm

Re: Windows global scale

Post by Pienkaito »

Perhaps you could disable dpi scaling on love.conf?

Code: Select all

function love.conf(t)
	t.window.usedpiscale = false
end
User avatar
darkfrei
Party member
Posts: 1169
Joined: Sat Feb 08, 2020 11:09 pm

Re: Windows global scale

Post 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.
Attachments
2020-12-30T15_00_03-graph, universal-neural-network v.1-03 (Löve v.11.3).png
2020-12-30T15_00_03-graph, universal-neural-network v.1-03 (Löve v.11.3).png (26.24 KiB) Viewed 5621 times
2020-12-30T14_58_08-ZeroBrane Studio - D__Lua_love_tests_universal-neural-network_universal-neural-n.png
2020-12-30T14_58_08-ZeroBrane Studio - D__Lua_love_tests_universal-neural-network_universal-neural-n.png (1.79 KiB) Viewed 5623 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Windows global scale

Post by pgimeno »

I think usedpiscale is about Android, and highdpi is about Windows and MacOS.
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Windows global scale

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 52 guests