push - a resolution-handling library

slime
Solid Snayke
Posts: 2763
Joined: Mon Aug 23, 2010 6:45 am
Contact:

Re: push: a resolution-handling library

It would probably be beneficial to use [wiki]love.window.setFullscreen[/wiki] rather than [wiki]love.window.setMode[/wiki] when switching between fullscreen and windowed mode. The former function doesn't need to reload OpenGL objects or recreate the window, so it's more efficient and it leaves Canvases and shader extern/uniforms intact.

Ulydev
Party member
Posts: 421
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: push: a resolution-handling library

slime wrote:It would probably be beneficial to use [wiki]love.window.setFullscreen[/wiki] rather than [wiki]love.window.setMode[/wiki] when switching between fullscreen and windowed mode. The former function doesn't need to reload OpenGL objects or recreate the window, so it's more efficient and it leaves Canvases and shader extern/uniforms intact.
Wow, I didn't know that was faster! Thanks slime

EDIT: I just tried it and it seems like it's keeping resolution too. It looks very blurry if I have a small window resolution...

slime
Solid Snayke
Posts: 2763
Joined: Mon Aug 23, 2010 6:45 am
Contact:

Re: push: a resolution-handling library

For exclusive-fullscreen it uses the closest fullscreen mode to the windowed-mode resolution, yeah. Fullscreen-desktop mode always uses the resolution of the desktop, however.

Ulydev
Party member
Posts: 421
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: push: a resolution-handling library

slime wrote:For exclusive-fullscreen it uses the closest fullscreen mode to the windowed-mode resolution, yeah. Fullscreen-desktop mode always uses the resolution of the desktop, however.
Thanks! It now works as expected.

Prole
Posts: 15
Joined: Wed Jan 15, 2014 8:38 am

Re: push: a resolution-handling library

Great!

Two suggestions:
2 Not change love.resize so roughly

zorg
Party member
Posts: 2307
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: push: a resolution-handling library

padicao2010 wrote:Not change love.resize so roughly
From looking at the code, i did not see it even using love.resize anywhere, and even if it would, it would only do a few calculations with push:resize... so i don't see the problem.

Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

Prole
Posts: 15
Joined: Wed Jan 15, 2014 8:38 am

Re: push: a resolution-handling library

zorg wrote:
From looking at the code, i did not see it even using love.resize anywhere, and even if it would, it would only do a few calculations with push:resize... so i don't see the problem.
Here, line 106

Code: Select all

function love.resize(w, h) return push:resize(w, h) end
Actually, it's not a big problem. I just commented it and write my resize with push:resize in my codes, for I have some other codes in love.resize.

zorg
Party member
Posts: 2307
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: push: a resolution-handling library

I stand corrected, you are right
Ulydev: Redefining love.resize in the code is not really a good idea, why not let the user just put the push:resize callback themselves into love.resize on their own?
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

Ulydev
Party member
Posts: 421
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: push: a resolution-handling library

Done!

Added a license and removed the love.resize definition. You'll now have to call push:resize(w, h) yourself.

Thank you guys for the suggestions!

soulaymenc
Prole
Posts: 34
Joined: Thu Jul 11, 2013 2:03 pm
Contact:

Re: push: a resolution-handling library

awesome projet, really nice to see a lot of people making awesome libs for löve keep up, i'll use it one day and i will tell you
This world is so strange.

Who is online

Users browsing this forum: No registered users and 5 guests