         [ 2drop ] if
     ] if-zero ;
 
-: (run-loop) ( loop -- )
-    dup running?>>
-    [ [ MAX-FRAMES-TO-SKIP ?tick ] [ redraw ] [ yield (run-loop) ] tri ]
-    [ drop ] if ;
-
-: run-loop ( loop -- )
-    dup game-loop
-    [ [ (run-loop) ] [ game-loop-error ] recover ]
-    with-variable ;
-
 : benchmark-micros ( loop -- micros )
     system-micros swap benchmark-time>> - ;
 

: benchmark-frames-per-second ( loop -- n )
    [ frame-number>> ] [ benchmark-frame-number>> - ] [ benchmark-micros ] tri /f ;

: start-loop ( loop -- )
    system-micros >>last-tick
    t >>running?
    [ reset-loop-benchmark ]
    [ [ run-loop ] curry "game loop" spawn ]
    [ thread<< ] tri ;

: stop-loop ( loop -- )

    drop ;

: <game-loop*> ( tick-interval-micros tick-delegate draw-delegate -- loop )
    system-micros f f 0 0 system-micros 0 0 f
    game-loop boa ;

: <game-loop> ( tick-interval-micros delegate -- loop )
