How about a more visual test.
The upper line is based on monitor vsync and the bottom line is based on dt.
Not much difference eh? But look closely and you'll see that one line has more jitter than the other.
monitorDTposition = 0
loveDTposition = 0
monitorDT = 1 / select(3,love.window.getMode()).refreshrate
function love.update(dt)
loveDT = dt
monitorDTposition = monitorDTposition + monitorDT * 197.894563
loveDTposition = loveDTposition + loveDT * 197.894563
if monitorDTposition > 800 then -- Reset code
monitorDTposition = -10
loveDTposition = -10
end
end
function love.draw()
love.graphics.rectangle("fill",monitorDTposition,190,10,100)
love.graphics.rectangle("fill",loveDTposition,310,10,100)
end
function love.timer.sleep() end -- Easy hack to kill the function
function love.keypressed(key)
if key == "escape" then
love.event.quit()
end
end
Evine wrote:How about a more visual test.
The upper line is based on monitor vsync and the bottom line is based on dt.
Not much difference eh? But look closely and you'll see that one line has more jitter than the other.
monitorDTposition = 0
loveDTposition = 0
monitorDT = 1 / select(3,love.window.getMode()).refreshrate
function love.update(dt)
loveDT = dt
monitorDTposition = monitorDTposition + monitorDT * 197.894563
loveDTposition = loveDTposition + loveDT * 197.894563
if monitorDTposition > 800 then -- Reset code
monitorDTposition = -10
loveDTposition = -10
end
end
function love.draw()
love.graphics.rectangle("fill",monitorDTposition,190,10,100)
love.graphics.rectangle("fill",loveDTposition,310,10,100)
end
function love.timer.sleep() end -- Easy hack to kill the function
function love.keypressed(key)
if key == "escape" then
love.event.quit()
end
end
The question isn't whether there's jitter, the question is whether that jitter matters
Both jitter the same amount the same time on my machine... so yeah
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.
Hey guys, thanks for the responses. I totally get why that doesn't work. Also I enabled Vsynch and the problem is totally gone. Problem gone so thanks.