Love ignores resolution settings in Conf and SetMode

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
Justin_C
Prole
Posts: 8
Joined: Wed Oct 08, 2014 2:23 am

Love ignores resolution settings in Conf and SetMode

Post by Justin_C »

I'm having some issues setting the resolution in Love (Windows 8.1) and it's really bugging me. I've tried setting the resolution to 1920x1080 in both Conf.lua and by using SetMode, and no matter what I do it always seems to use 1536x864 as the resolution.

1920x1080 is my native resolution. And I only noticed the issue because Fraps has been repeatedly recording at that resolution instead of 1920x1080, so I know the window is actually using that resolution.

Here's a code sample to show you what I am doing:

Code: Select all

function love.load()
  window_height_conf = love.window.getHeight()
  window_width_conf = love.window.getWidth()

  love.window.setMode(1920, 1080, SetMode())
  
  window_height_setmode = love.window.getHeight()
  window_width_setmode = love.window.getWidth()
  
  font_24 = love.graphics.newFont(24)
  love.graphics.setFont(font_24)
end

function love.draw(dt)
  local text = "Conf: (" .. window_width_conf .. ", " .. window_height_conf .. ")"
  love.graphics.printf(text, window_width_setmode - ((love.graphics.getFont():getWidth(text) + 10)), 10, 1000, "left", 0, 1, 1)
  text = "SetMode: (" .. window_width_setmode .. ", " .. window_height_setmode .. ")"
  love.graphics.printf(text, window_width_setmode - ((love.graphics.getFont():getWidth(text) + 10)), 15 + love.graphics.getFont():getHeight(text), 1000, "left", 0, 1, 1)
end

function SetMode()
  local r = {}
  r.fullscreen = true
  r.fullscreentype = "desktop"
  r.vsync = true
  r.fsaa = 2
  r.resizable = false
  r.borderless = false
  r.centered = true
  r.display = 1
  r.minwidth = 1
  r.minheight = 1
  r.highdpi = false
  r.srgb = false
  r.x = nil
  r.y = nil
  
  return r
end
I set the resolution as 1920x1080 in Conf.lua as well, which you can see in the attachment. The resolution turns out the same whether I manually set the mode or not. It runs at the same resolution whether I run it in ZeroBrane Studio, through Love using a .love file, or when I compile it into an .exe. No matter what I do it just refuses to use the resolution I specified.

Someone please help me with this. If I can't get Love to run at the proper resolution I'm going to have to stop using it, and I don't want to do that.

EDIT: If I switch the fullscreen mode to "normal" it sets the resolution to 1600x900. It seems to have a mind of its own.
Attachments
Resolution.love
(1.44 KiB) Downloaded 95 times
User avatar
Evine
Citizen
Posts: 72
Joined: Wed May 28, 2014 11:46 pm

Re: Love ignores resolution settings in Conf and SetMode

Post by Evine »

I'd guess you have scaling enabled in windows.

Similar issue:
viewtopic.php?f=3&t=79614&p=179911#p179911
Artal, A .PSD loader: https://github.com/EvineDev/Artal
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Love ignores resolution settings in Conf and SetMode

Post by bartbes »

Yes, in desktop fullscreen mode it makes the window as big as the desktop. This is intended and documented.
If fullscreen is enabled and the width or height is not supported (see love.window.getFullscreenModes), the window may be resized to the closest available resolution and a resize event will be triggered.

If the fullscreen type is "desktop", then the window will be automatically resized to the desktop resolution.
Justin_C
Prole
Posts: 8
Joined: Wed Oct 08, 2014 2:23 am

Re: Love ignores resolution settings in Conf and SetMode

Post by Justin_C »

Yeah, that fixed it. Thanks!
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests