add word-evt

This commit is contained in:
Jay McCarthy 2015-04-14 14:00:59 -04:00
parent 818fc3d419
commit 6099125a86
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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)