I do something like this:
You can even enclose the Select WaitEvent() block in a Select GameState block, along with more Select WaitEvent() blocks for other states. Unless your logic/rendering takes more than 1/60th of a second, it will run smooth, and no faster than 60 hertz.
CreateTimer(60) InitGui() InitGame() Repeat Select WaitEvent() Case $803 : End ; other cases here (input, etc) Case $4001 Logic() Update() Render() End Select Forever
You can even enclose the Select WaitEvent() block in a Select GameState block, along with more Select WaitEvent() blocks for other states. Unless your logic/rendering takes more than 1/60th of a second, it will run smooth, and no faster than 60 hertz.