add word-evt
This commit is contained in:
parent
818fc3d419
commit
6099125a86
|
@ -72,6 +72,11 @@ Returns a label for @racket[w] that could use @racket[frame-time] to
|
|||
show the performance of the @tech{word} rendering. By default, returns
|
||||
@racket[(lux-standard-label "Lux" frame-time)].}
|
||||
|
||||
@defproc[(word-evt [w word?]) evt?]{
|
||||
|
||||
Returns a synchronizable event that the @tech{word} @racket[w]
|
||||
requires notification of. By default, returns @racket[never-evt].}
|
||||
|
||||
@defproc[(word-event [w word?] [e any/c]) word?]{
|
||||
|
||||
Returns a @tech{word} based on @racket[w] that integrates the
|
||||
|
|
6
word.rkt
6
word.rkt
|
@ -10,6 +10,7 @@
|
|||
(define-generics word
|
||||
(word-fps word)
|
||||
(word-label word frame-time)
|
||||
(word-evt word)
|
||||
(word-event word evt)
|
||||
(word-tick word)
|
||||
(word-output word)
|
||||
|
@ -19,6 +20,8 @@
|
|||
60.0)
|
||||
(define (word-label w frame-time)
|
||||
(lux-standard-label "Lux" frame-time))
|
||||
(define (word-evt w)
|
||||
never-evt)
|
||||
(define (word-event w e) w)
|
||||
(define (word-tick w) w)
|
||||
(define (word-output w) #f)
|
||||
|
@ -74,7 +77,8 @@
|
|||
(define (body next-time w)
|
||||
(define input-evt
|
||||
(handle-evt
|
||||
(chaos-event c)
|
||||
(choice-evt (word-evt w)
|
||||
(chaos-event c))
|
||||
(λ (e)
|
||||
(update-word w
|
||||
(λ (w)
|
||||
|
|
Loading…
Reference in New Issue