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.

P#78233 2020-06-18 17:19

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.

P#78235 2020-06-18 18:40 ( Edited 2020-06-18 18:52)

@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.

P#78244 2020-06-18 21:13

Thank you everyone!
I solved this problem with you.

P#78254 2020-06-19 02:04

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-18 00:22:03 | 0.031s | Q:13