From 6099125a86c37ae12c48eeb88127c9ccc29fffab Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Tue, 14 Apr 2015 14:00:59 -0400 Subject: [PATCH] add word-evt --- scribblings/lux.scrbl | 5 +++++ word.rkt | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scribblings/lux.scrbl b/scribblings/lux.scrbl index 0e37587..fc6d1d4 100644 --- a/scribblings/lux.scrbl +++ b/scribblings/lux.scrbl @@ -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 diff --git a/word.rkt b/word.rkt index 2768cc7..0675787 100644 --- a/word.rkt +++ b/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)