Is it possible to make some sort off loadDraw() function? Where you basically just draw all your canvases that wont change during the game (like game terrain) once. (as calling the graphics module during load does not work :< )
After which u just always call your canvas in the regular draw function? Or do I go about it by overwriting the draw function after 1 cycle or something similar?
"Questions that don't deserve their own thread" thread
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: "Questions that don't deserve their own thread" thread
just do it somewhere. wherever you want. You can do it in love.load, in the first call to love.update, in the first call to love.draw, every frame (don't actually do this), even anywhere else in your main.lua or files that you require.Smoggert wrote:Is it possible to make some sort off loadDraw() function? Where you basically just draw all your canvases that wont change during the game (like game terrain) once. (as calling the graphics module during load does not work :< )
After which u just always call your canvas in the regular draw function? Or do I go about it by overwriting the draw function after 1 cycle or something similar?
Re: "Questions that don't deserve their own thread" thread
s-ol wrote:just do it somewhere. wherever you want. You can do it in love.load, in the first call to love.update, in the first call to love.draw, every frame (don't actually do this), even anywhere else in your main.lua or files that you require.Smoggert wrote:Is it possible to make some sort off loadDraw() function? Where you basically just draw all your canvases that wont change during the game (like game terrain) once. (as calling the graphics module during load does not work :< )
After which u just always call your canvas in the regular draw function? Or do I go about it by overwriting the draw function after 1 cycle or something similar?
O, I was for some reason under the impression that graphics calls didn't work outside of love.draw()
But it was probably something I just did wrong in the past.
Thanks
Re: "Questions that don't deserve their own thread" thread
The only limitation there is afaik is that graphics functions don't work (or at least are extremely likely to break stuff) outside of the main thread.Smoggert wrote:s-ol wrote:
O, I was for some reason under the impression that graphics calls didn't work outside of love.draw()
But it was probably something I just did wrong in the past.
Thanks
Re: "Questions that don't deserve their own thread" thread
The whole screen needs to be redrawn every frame, otherwise when you move away a window that covers the LÖVE window, it doesn't repaint. You can't just draw once and expect it to persist.
Drawing to the screen doesn't work outside love.draw because the default love.run clears the screen right before calling love.draw, erasing anything that was drawn before. The reason why it's cleared every frame is the above.
Drawing to the screen doesn't work outside love.draw because the default love.run clears the screen right before calling love.draw, erasing anything that was drawn before. The reason why it's cleared every frame is the above.
- parallax7d
- Citizen
- Posts: 82
- Joined: Wed Jul 02, 2014 11:44 pm
Re: "Questions that don't deserve their own thread" thread
Does Love use just 1 OpenGL context or multiple? When we feed in our own shaders are these all put into the same context as the main Love context?
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: "Questions that don't deserve their own thread" thread
There is only a single OpenGL context. Multi-context OpenGL is kind of a mess.
Re: "Questions that don't deserve their own thread" thread
He was talking about drawing static parts to canvases, then drawing them as quads unless I am the one who misunderstood.pgimeno wrote:The whole screen needs to be redrawn every frame, otherwise when you move away a window that covers the LÖVE window, it doesn't repaint. You can't just draw once and expect it to persist.
Drawing to the screen doesn't work outside love.draw because the default love.run clears the screen right before calling love.draw, erasing anything that was drawn before. The reason why it's cleared every frame is the above.
Re: "Questions that don't deserve their own thread" thread
Exactlys-ol wrote:He was talking about drawing static parts to canvases, then drawing them as quads unless I am the one who misunderstood.
- Le_juiceBOX
- Citizen
- Posts: 71
- Joined: Sat Mar 26, 2016 3:07 pm
Re: "Questions that don't deserve their own thread" thread
What are the advantages and disadvantages for using canvases?
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 6 guests