Rendering flicker
Posted: Sun Dec 20, 2015 9:18 am
So with my current project I am making it with two rendering levels. "world objects" and "screen objects", world objects are rendered relative to the "camera" object's orientation, screen objects are relative to the screen.
The camera effects on the world objects are handled with the graphics coordinate system functions, so to avoid doing a bunch of math to "reverse" the effects when rendering the screen objects I am just editing the love.run function.
Original:
Mine:
Now, as is, only the world objects are rendered smoothly, the screen objects are flickering for some reason.
What is causing this? And how can it be fixed?
Version 0.9.2
The camera effects on the world objects are handled with the graphics coordinate system functions, so to avoid doing a bunch of math to "reverse" the effects when rendering the screen objects I am just editing the love.run function.
Original:
Code: Select all
love.graphics.clear()
love.graphics.origin()
if love.draw then love.draw() end
love.graphics.present()
Code: Select all
love.graphics.clear()
love.graphics.origin()
if draw then -- draw is a function that handles world object drawing
draw()
love.graphics.present()
end
if drawScreen then -- drawScreen is a function that handles screen object drawing
love.graphics.origin() -- reset the camera effects
drawScreen() -- draw them
love.graphics.present() -- render them
end
What is causing this? And how can it be fixed?
Version 0.9.2