Log In  


Usually, If it takes longer than 1/30 sec, frame is skipped automatically.
But I want to refuse it. How can I turn off "Auto Frame Skip" ?
Of course, Game is sometimes slow. I know.



To achieve this, put all of your draw calls in the _update function. If I understood things right, _draw calls get skipped when CPU time goes too high, but _update calls get executed always, even if they would take too long to be in time for the current frame. So if you put your draw code inside the _update function, then instead of skipping frames, the execution should actually slow down.


@Mugen2411 This seems to be an example of what @Decidetto is talking about:

function _init()
	frames=0
	omgwaytoolong=32000
end

function _update()
	for i=1,omgwaytoolong do
		oof=sqrt(i)
	end
	frames+=1

	draw()
end

function draw()
	cls()
	print("  time:"..t())
	print("frames:"..frames)
	print("   fps:"..(frames/t()))
	print("   cpu:"..stat(1))
	circ(frames%128,64,10)
	flip()
end

You can see how long it takes "1 second" to pass.


Thank you everyone!
I solved this problem with you.



[Please log in to post a comment]