push - a resolution-handling library

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
pgimeno
Party member
Posts: 3709
Joined: Sun Oct 18, 2015 2:58 pm

Re: push - a resolution-handling library

Post by pgimeno »

dusoft wrote: Sun Mar 19, 2023 6:20 am Indeed, but this is what scenes are for. You should still refrain from repeatedly creating/loading resource in love.update().
Sure thing. But scenes are most often switched in love.update via a timer or similar. The person who asked was having a problem during the loading of a game, and explicitly specified: "My canvas creation and drawing only gets called once".
Pezy
Prole
Posts: 2
Joined: Fri Feb 28, 2025 8:46 pm

Re: push - a resolution-handling library

Post by Pezy »

This is a great library from what I've seen but I've found one problem. Whenever I go to play my game, a game window opens and closes immediately after. Then a second window opens and the game starts. I've tried to see what's causing the error but I honestly just don't understand any of the push.lua code. So is this just me having the issue or is this a general problem. Also if anyone knows how to fix this I would greatly appreciate the knowledge :D

Edit: nevermind I fixed the problem, if you replace the lines

windowUpdateMode(self._RWIDTH, self._RHEIGHT, {
fullscreen = self._fullscreen,
resizable = self._resizable,
highdpi = self._highdpi
})

with this set of lines

local currentWidth, currentHeight, flags = love.window.getMode()

-- Only update the window mode if the settings actually changed
if currentWidth ~= self._RWIDTH or currentHeight ~= self._RHEIGHT
or flags.fullscreen ~= self._fullscreen
or flags.resizable ~= self._resizable then

love.window.setMode(self._RWIDTH, self._RHEIGHT, {
fullscreen = self._fullscreen,
resizable = self._resizable,
highdpi = self._highdpi
})
end

the error stops occurring and the screen opens normally :awesome:
Last edited by Pezy on Fri Feb 28, 2025 9:25 pm, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests