Code: Select all
function love.run()
love.graphics.setBackgroundColor(1,1,1)
love.graphics.origin()
love.graphics.clear(love.graphics.getBackgroundColor())
-- could call love.draw() here
love.graphics.present()
-- Main loop time.
return function()
-- Process events.
if love.event then
love.event.pump()
for name, a,b,c,d,e,f in love.event.poll() do
if name == "quit" then
if not love.quit or not love.quit() then
return a or 0
end
end
love.handlers[name](a,b,c,d,e,f)
end
-- update screen only on events
love.graphics.clear(love.graphics.getBackgroundColor()) -- A
-- could call love.draw() here
love.graphics.present()
end
love.timer.sleep(0.001)
end
end
However, if I delete the line labeled A, because I want to not clear the screen on every frame, the screen starts to flicker.
Does anyone understand why this happens?