Page 1 of 1
Get Screen size is incorrect?
Posted: Wed Jul 08, 2015 11:06 am
by FlashFire
For A game I'm making, I am forcing it to be lower resolution than the max resolution(for high resolution systems), so the max resolution is 1920x1080p. My laptop runs at 3200x1800, so in conf.lua I changed the settings for fullscreen = true, width = 1920, height = 1080. So this should make the screen 1920 x 1080 right? love.graphics.getWidth and love.graphics.getHeight report back 1920 by 1080, but while putting my mouse in the lower right corner of the screen and then printing the position of the mouse, I get 1279x720. Which is near 720p compared to the 1080p I want. I know my laptop can go to almost 4k resolution, so 1080 is easy for it.
Am I doing something wrong?
Re: Get Screen size is incorrect?
Posted: Wed Jul 08, 2015 4:15 pm
by FlashFire
Ah, I found the reason, I have the scaling(Size of text and other elements) level on my PC to be 150%. So Love2d apparently uses that when it draws the screen. So the screen maybe 1920x1080, but with scaling a 150% 1280x720 are all that would show on the screen.
Would there be a way to check the true screen resolution that shows on the screen? Or get the amount of scale that is used? Or even change the scaling to 100% just while the game runs.
Re: Get Screen size is incorrect?
Posted: Wed Jul 08, 2015 4:22 pm
by slime
LÖVE uses the SDL library for cross-platform windowing-related functionality, and unfortunately SDL doesn't have high-dpi / dpi scaling awareness support for Windows right now.
SDL also has a related bug with fullscreen dimensions in Windows when DPI scaling is different than 100%, which I think you're encountering. Maybe you could try
fullscreen-desktop mode instead of 'exclusive' fullscreen?
Re: Get Screen size is incorrect?
Posted: Wed Jul 08, 2015 6:15 pm
by FlashFire
Fullscreen Desktop mode still uses window's scaling. The only change is I can't set the screen resolution, it is constantly 2133 by 1200. On the bright side though, love.graphics.getWidth and getHeight both work correctly.
I guess I could probably get away with love.graphics.scale(), was hoping for the easy way though.
Re: Get Screen size is incorrect?
Posted: Thu Jul 09, 2015 12:10 am
by slime
Yeah, fullscreen-desktop mode will always use the same dimensions as the desktop.