2

I'm trying to learn love2d and I am having an issue with fullscreen. no matter how I try to set the resolution, it always ends up setting itself to 1536x864. My native resolution is 1920x1080, and I am trying to set the game's resolution to 1280x720. I've tried including this in conf.lua:

t.window.width = 1280
t.window.height = 720
t.window.fullscreen = true

I know conf.lua is being loaded, because it does go to fullscreen, and the window title is setting correctly from there. I've tried also doing it via love.window.setMode() in love.load() as follows:

local mode_flags = {}
mode_flags['fullscreen'] = true
love.window.setMode(1280, 720, mode_flags)

These are the two methods I found online, and both end up with a 1536x864 resolution (which is not even one of the resolutions available on my monitor, as best I can tell). Why is it doing this, and how can I fix it?

EDIT: Having found this forum discussion, I understand that the reason I was getting this specific resolution was due to the DPI scaling assigned by windows. I navigated to love.exe in my install dir, and pulled up its Properties window. Under Compatibility, I clicked 'Change high DPI settings', then enabled 'Override high DPI behaviour' under 'High DPI scaling override', and selected 'Application' on the associated dropdown menu. Applying these settings resolved half of my issue; I'm not longer getting the strange resolution. However, I am now getting my native resolution (1080p), regardless of assigning width and height to 1280 and 720 in conf.lua or by using love.window.setMode() in love.load(). Why does love ignore any resolution I set on fullscreen, and how can I resolve the issue? Thanks in advance, by the way.

6
  • The monitor is just one part limiting the set of possible resolutions. Did you check that the complete environment (graphics card/on-board graphics, driver) are able to use this resolution, for example by using your OS? Commented Dec 3, 2024 at 7:32
  • Are you using a retina monitor? If you call getMode right after setMode, is the resolution also 1536x864? Commented Dec 3, 2024 at 7:35
  • The documentation mentions FullscreenType and specific behavior. Did you check this? Which version of love2d are you using? Commented Dec 3, 2024 at 7:38
  • 1
    hey guys, thanks for responding. I was just updating the post to explain that I figured out the source of that resolution, and it's now rendering at 1080p (the resolution I have my display set to). however, that's not the resolution I've set in my love code. see the addendum to my question for a full explanation. Commented Dec 3, 2024 at 7:39
  • And then there is love2d.org/wiki/love.window.getFullscreenModes to check. Commented Dec 3, 2024 at 7:40

1 Answer 1

3

I was able to figure this out thanks to the people at the love2d subreddit. apparently, fullscreen defaults to borderless, and thus takes on the desktop resolution. however, it's possible to change the fullscreen type to 'exclusive', which has the behaviour I wanted, in a few ways. I went with adding this line to conf.lua:

t.window.fullscreentype = 'exclusive'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.