Clinton J
Clinton J

Reputation: 2123

screen resolution always overridden

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.

Upvotes: 2

Views: 82

Answers (1)

Clinton J
Clinton J

Reputation: 2123

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'

Upvotes: 3

Related Questions