natiny.backend.loop

Lua
natiny.backend.loop(callback)

Starts the main application loop. The callback is called once per frame.

Parameters

Name Type Description
callback function Function called every frame with delta time in seconds

Example

Lua
natiny.backend.loop(function(dt)
    update(dt)
end)

Notes

  • On web this uses requestAnimationFrame.