Paste: new game loop

Author: typemore
Mode: factor
Date: Thu, 19 Aug 2010 18:05:51
Plain Text |
: tick ( loop -- )
    [
        [ [ tick-delegate>> tick* ] with-benchmarking ]
        [ [ draw-delegate>> draw* ] with-benchmarking ] bi
    ] keep record-benchmarking ;


: start-loop ( loop -- )
    t >>running?

    dup
    [ '[ _ tick-iteration ] f ]
    [ tick-interval-nanos>> nanoseconds ] bi <timer> >>tick-timer

!    dup '[ _ frame-iteration ] f 1 milliseconds <timer> >>draw-timer

!    [ tick-timer>> ] [ draw-timer>> ] bi [ start-timer ] bi@ ;
     tick-timer>> start-timer ;

Annotation: compiler error

Author: typemore
Mode: factor
Date: Thu, 19 Aug 2010 18:11:09
Plain Text |
: tick ( loop -- )
    [
        [ [ tick-delegate>> tick* ] with-benchmarking ]
        [ [ draw-delegate>> 0.0 swap draw* ] with-benchmarking ] bi
    ] keep record-benchmarking ;

New Annotation

Summary:
Author:
Mode:
Body: