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
|
show the performance of the @tech{word} rendering. By default, returns
|
||||||
@racket[(lux-standard-label "Lux" frame-time)].}
|
@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?]{
|
@defproc[(word-event [w word?] [e any/c]) word?]{
|
||||||
|
|
||||||
Returns a @tech{word} based on @racket[w] that integrates the
|
Returns a @tech{word} based on @racket[w] that integrates the
|
||||||
|
|
6
word.rkt
6
word.rkt
|
@ -10,6 +10,7 @@
|
||||||
(define-generics word
|
(define-generics word
|
||||||
(word-fps word)
|
(word-fps word)
|
||||||
(word-label word frame-time)
|
(word-label word frame-time)
|
||||||
|
(word-evt word)
|
||||||
(word-event word evt)
|
(word-event word evt)
|
||||||
(word-tick word)
|
(word-tick word)
|
||||||
(word-output word)
|
(word-output word)
|
||||||
|
@ -19,6 +20,8 @@
|
||||||
60.0)
|
60.0)
|
||||||
(define (word-label w frame-time)
|
(define (word-label w frame-time)
|
||||||
(lux-standard-label "Lux" frame-time))
|
(lux-standard-label "Lux" frame-time))
|
||||||
|
(define (word-evt w)
|
||||||
|
never-evt)
|
||||||
(define (word-event w e) w)
|
(define (word-event w e) w)
|
||||||
(define (word-tick w) w)
|
(define (word-tick w) w)
|
||||||
(define (word-output w) #f)
|
(define (word-output w) #f)
|
||||||
|
@ -74,7 +77,8 @@
|
||||||
(define (body next-time w)
|
(define (body next-time w)
|
||||||
(define input-evt
|
(define input-evt
|
||||||
(handle-evt
|
(handle-evt
|
||||||
(chaos-event c)
|
(choice-evt (word-evt w)
|
||||||
|
(chaos-event c))
|
||||||
(λ (e)
|
(λ (e)
|
||||||
(update-word w
|
(update-word w
|
||||||
(λ (w)
|
(λ (w)
|
||||||
|
|
Loading…
Reference in New Issue