Downsampling issues

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
khamarr3524
Prole
Posts: 41
Joined: Thu Sep 05, 2013 8:48 pm

Downsampling issues

Post by khamarr3524 »

Hey everyone, I'm working on a project currently and I'm having an issue with my Graphics settings UI.

I'm using several libraries from this forum, all with due credit I assure you, and at first it seemed as though these complexities in my code could have been the cause of this issue but after running a clean environment of only resizing the window to various resolutions as the list from love.window.getFullscreenModes() entails, larger screens than can fit on my screen shut the application down. So why is this? Is there something I'm not doing correctly?

TL;DR What's the appropriate way to go about resolutions in this sense. I'm talking mainly about graphic settings (fullscreen, borderless fullscreen, windowed) with resolutions pulled from the machine.
User avatar
artofwork
Citizen
Posts: 91
Joined: Mon Sep 15, 2014 1:17 am
Location: East Coast USA

Re: Downsampling issues

Post by artofwork »

Post your code or love file and we can help you.
khamarr3524
Prole
Posts: 41
Joined: Thu Sep 05, 2013 8:48 pm

Re: Downsampling issues

Post by khamarr3524 »

For some strange reason it's working today... Before when I would change the size it would occasionally crash the program but it seems to not be doing that after I haven't touched the code. It's strange. Perhaps a computer issue? My testing code was very simple, I have it below. There are some strange flickers from odd-ball resolutions but I think this is expected? Should I also expect some resolutions to render partially off screen in fullscreen mode? I know I see this a lot from games like League of Legends.

Code: Select all

function love.load()
  res = love.window.getFullscreenModes()
  resCount = table.getn(res)
  cur = 1
  love.window.setFullscreen(true, "desktop")
end

function love.draw()
  love.graphics.print(res[cur].width .. "X" .. res[cur].height, 5, 5)
  love.graphics.circle("fill", 100, 100, 10, 3)
end

function love.keypressed(key)
  resize()
end

function resize()
  love.window.setMode(res[cur].width, res[cur].height)
  love.window.setFullscreen("normal")
  if cur == resCount then
    cur = 1
  else
    cur = cur + 1
  end
end
Edit: Does anyone know if you need to pass the flags to love.window.setMode in order to retain them. I.E. Does not passing the flags cause them to return to a default?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Downsampling issues

Post by bartbes »

khamarr3524 wrote: Edit: Does anyone know if you need to pass the flags to love.window.setMode in order to retain them. I.E. Does not passing the flags cause them to return to a default?
The flags have default values too, yes, and it doesn't retain the old settings for you.
khamarr3524
Prole
Posts: 41
Joined: Thu Sep 05, 2013 8:48 pm

Re: Downsampling issues

Post by khamarr3524 »

Could you also explain why some resolutions print partially off screen. Specifically it appears as though the "upper left hand corner" of where drawing starts goes beyond my screens to the left and occasionally up. Is this due to the DPI or ?
User avatar
artofwork
Citizen
Posts: 91
Joined: Mon Sep 15, 2014 1:17 am
Location: East Coast USA

Re: Downsampling issues

Post by artofwork »

khamarr3524 wrote:Could you also explain why some resolutions print partially off screen. Specifically it appears as though the "upper left hand corner" of where drawing starts goes beyond my screens to the left and occasionally up. Is this due to the DPI or ?
I think it is because its possible your going beyond the resolution of what your graphics card / monitor can handle

When I run this code it gives me all the possible resolutions

Code: Select all

function love.draw()
  love.graphics.print(res[cur].width .. "X" .. res[cur].height, 5, 5)
  love.graphics.circle("fill", 100, 100, 10, 3)
  for _, r in pairs(res) do
	love.graphics.print(_.." ) width "..r.width.." height "..r.height, 10, 25*_)
	end
end
the image below might be a little helpfull
khamarr3524
Prole
Posts: 41
Joined: Thu Sep 05, 2013 8:48 pm

Re: Downsampling issues

Post by khamarr3524 »

It's most likely the monitor. I'm only pulling the valid resolutions via love.window.getFullscreenModes() though so idk why that would be an issue. Specifically, I was using only the valid dimensions for my monitor that is being rendered to.
Post Reply

Who is online

Users browsing this forum: No registered users and 207 guests