Hello!
I am trying to run love game on 4k monitor and found some problem here.
If "font scale" in windows "screen preferences" is set up to 100% then everything works fine.
But if I change font scale to (for example) 200% then windows forces all applications to render in half resolotion and displays it scaled up by 200%. Except applications that tell windows that they can handle resolution inside correctly (for example Google chrome, Discord, modern 3d games...). They renders in full resolution as they can. My love game is not doing this, so it renders in half resolution Also love.graphics.getDimensions() returns half resolution, for example 640x480 while real game window size is 1280x960.
Is here a way to fix this?
I have tried highdpi = true in love.window.setMode, but it does nothing on windows, as the wiki tells.
Handle High DPI displays on windows
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Handle High DPI displays on windows
Found one way to handle this.
Checkbox in exe file propetries.
MyGame.exe in packaged mode or love.exe in development mode.
This solves the problem perfectly on one computer: if system handles highdpi scaling (this is by default) - we have "big" pixels, otherwise we have normal pixels. But it information stores somewhere deep in OS, so after transfer to another computer this checkbox will be lost. This leads to some problems with game distributions.
Perfect solution is a way to change this inside from love dynamically. But I don't know how to do this.
Checkbox in exe file propetries.
MyGame.exe in packaged mode or love.exe in development mode.
This solves the problem perfectly on one computer: if system handles highdpi scaling (this is by default) - we have "big" pixels, otherwise we have normal pixels. But it information stores somewhere deep in OS, so after transfer to another computer this checkbox will be lost. This leads to some problems with game distributions.
Perfect solution is a way to change this inside from love dynamically. But I don't know how to do this.
Re: Handle High DPI displays on windows
It looks like this will be fixed in 0.11.0:
You could try compiling it yourself or downloading a nightly build to see if that fixes the problem.The wiki wrote:Changed high-dpi functionality to require much less code (often none at all) for graphics to appear at the correct sizes and positions.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Handle High DPI displays on windows
Unfortunately LÖVE still doesn't support high dpi on Windows, since SDL doesnt support it yet (because Microsoft's high dpi / dpi scaling APIs are hard to work with and can't replicate the functionality of other major operating systems).
Re: Handle High DPI displays on windows
Thanks for the response!
Unfortunately, but understandable
...And many many games and applications have problems with that, so this "Override high DPI scaling" drop-down-box has become the most usable feature for me in past year on windows.
Unfortunately, but understandable
...And many many games and applications have problems with that, so this "Override high DPI scaling" drop-down-box has become the most usable feature for me in past year on windows.
Re: Handle High DPI displays on windows
Found interesting note here in Additions section https://love2d.org/wiki/11.3
Will the 'usedpiscale' flag solve this high dpi problem on Windows?Added 'usedpiscale' boolean (true by default) to love.window.setMode and love.conf. Disables automatic DPI scaling when false.
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Handle High DPI displays on windows
No, high dpi (app-aware DPI scale) is still not supported on Windows. love's own automatic DPI scaling only happens when that's supported.
-
- Prole
- Posts: 12
- Joined: Fri Nov 03, 2017 5:19 pm
- Location: Pacific Northwest
- Contact:
Re: Handle High DPI displays on windows
When you modify the DPI settings in the file properties they get stored in the registry
From: https://superuser.com/questions/1230346 ... mmand-line
~ HIGHDPIAWARE Indicates value of Override high DPI scaling behavior (Application)
~ DPIUNAWARE Indicates value of Override high DPI scaling behavior (System)
~ GDIDPISCALING DPIUNAWARE Indicates value of Override high DPI scaling behavior (System Enhanced)
You can also set the setting temporarily in a batch file that launches your game:
From: https://superuser.com/questions/1230346 ... mmand-line
~ HIGHDPIAWARE Indicates value of Override high DPI scaling behavior (Application)
~ DPIUNAWARE Indicates value of Override high DPI scaling behavior (System)
~ GDIDPISCALING DPIUNAWARE Indicates value of Override high DPI scaling behavior (System Enhanced)
You can also set the setting temporarily in a batch file that launches your game:
Code: Select all
setlocal
pushd %~dp0\
set __COMPAT_LAYER=~ GDIDPISCALING DPIUNAWARE
love.exe game.love
popd
endlocal
Re: Handle High DPI displays on windows
@slime, thanks! I will be looking forward for future updates in future years
@jonthysell, that's a very useful information, thank you!
Changing it permanently or temporarily through bat files is an appropriate solution
@jonthysell, that's a very useful information, thank you!
Changing it permanently or temporarily through bat files is an appropriate solution
Who is online
Users browsing this forum: Bing [Bot] and 5 guests