How to prevent scaling in Windows?

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
Przemator
Party member
Posts: 107
Joined: Fri Sep 28, 2012 6:59 pm

How to prevent scaling in Windows?

Post by Przemator »

Hi

My screen resolution is 1920x1080. I am using the scaling of 150% on Windows 7.

This function:

Code: Select all

width, height = love.window.getDesktopDimensions( display )
Returns 1280x720.

In window mode, if I declare window size of 1000x600, it has a size of 1500x900, and everything is stretched, the pixels are not sharp.

How do I disable desktop scaling in a LOVE game? In settings of LOVE.exe, desktop scaling option is grayed out.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: How to prevent scaling in Windows?

Post by Jasoco »

Does enabling highdpi mode do anything to help?

Maybe take some screenshots of what it looks like wrong.
User avatar
Evine
Citizen
Posts: 72
Joined: Wed May 28, 2014 11:46 pm

Re: How to prevent scaling in Windows?

Post by Evine »

High DPI scaling for Windows/Linux is supported in Love2d or more accurately it is not in the underlying library SDL. So you either have to turn off scaling in windows or normal/exclusive fullscreen might give you the full resolution. (With the obvious problem that you're forced to use fullscreen)
Last edited by Evine on Fri Nov 13, 2015 12:31 am, edited 1 time in total.
Artal, A .PSD loader: https://github.com/EvineDev/Artal
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: How to prevent scaling in Windows?

Post by slime »

Actually SDL's Windows and Linux backends don't currently support high-dpi, unfortunately. Right now there's no real way for love to use the real pixel density of a display in Windows, if global DPI scaling is enabled on the system.
User avatar
Przemator
Party member
Posts: 107
Joined: Fri Sep 28, 2012 6:59 pm

Re: How to prevent scaling in Windows?

Post by Przemator »

I have googled and I found a workaround. For 64bit applications, the compatibility fields are grayed out. You have to manually add an entry in the Registry:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
In that key, create a String entry with:
Name = The full path to the .exe of your application
Type = String (REG_SZ)
Data = HIGHDPIAWARE
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 49 guests