push - a resolution-handling library

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
slime
Solid Snayke
Posts: 3161
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: push: a resolution-handling library

Post by slime »

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.
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: push: a resolution-handling library

Post by Ulydev »

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 :nyu:

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...
User avatar
slime
Solid Snayke
Posts: 3161
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: push: a resolution-handling library

Post by slime »

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.
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: push: a resolution-handling library

Post by Ulydev »

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. :awesome:
padicao2010
Prole
Posts: 15
Joined: Wed Jan 15, 2014 8:38 am

Re: push: a resolution-handling library

Post by padicao2010 »

Great!

Two suggestions:
1 Add LICENSE
2 Not change love.resize so roughly
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: push: a resolution-handling library

Post by zorg »

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.

I do agree with adding a license though.
Me and my stuff :3True 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.
padicao2010
Prole
Posts: 15
Joined: Wed Jan 15, 2014 8:38 am

Re: push: a resolution-handling library

Post by padicao2010 »

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.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: push: a resolution-handling library

Post by zorg »

I stand corrected, you are right :3
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 :3True 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.
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: push: a resolution-handling library

Post by Ulydev »

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! :awesome:
User avatar
soulaymenc
Prole
Posts: 36
Joined: Thu Jul 11, 2013 2:03 pm
Contact:

Re: push: a resolution-handling library

Post by soulaymenc »

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 :D
This world is so strange.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests