diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-03-08 18:20:44 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-03-08 18:20:44 -0500 |
commit | 0cc4219f9ea2a5b07f6ec3d48b74f40b81c1d565 (patch) | |
tree | 805bf37d0e92472b35cdd54af0f9d95c24f56067 | |
parent | 6a60f02c94d1131e78c7f76243077f8aaff6056a (diff) |
Update font example.
* examples/font.scm: Remove GC counter.
-rw-r--r-- | examples/font.scm | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/examples/font.scm b/examples/font.scm index 91acfc0..5087b1c 100644 --- a/examples/font.scm +++ b/examples/font.scm @@ -11,14 +11,15 @@ (load "common.scm") (define font (load-default-font 18)) -(define label (make-label font "The quick brown fox jumped over the lazy dog." - (vector2 320 240) #:anchor 'center)) +(define label + (make-label font "The quick brown fox jumped over the lazy dog." + (vector2 320 240) #:anchor 'center)) (define-signal fps-label (signal-map (lambda (fps) (let ((text (format #f "FPS: ~d" fps))) (make-label font text (vector2 0 0)))) - (signal-sample game-agenda 60 fps))) + fps)) (define-signal mouse-label (signal-map (lambda (p) @@ -26,25 +27,10 @@ (make-label font text (vector2 0 20)))) (signal-throttle game-agenda 5 mouse-position))) -(define-signal gc-counter (make-signal 0)) -(define-signal gc-label - (signal-map (lambda (counter) - (let ((text (format #f "GCs: ~d" counter))) - (make-label font text (vector2 0 40)))) - gc-counter)) - -(add-hook! after-gc-hook - (lambda () - (schedule game-agenda - (lambda () - (signal-set! gc-counter - (1+ (signal-ref gc-counter))))))) - (add-hook! draw-hook (lambda (dt alpha) (draw-label label) (draw-label (signal-ref fps-label)) - (draw-label (signal-ref mouse-label)) - (draw-label (signal-ref gc-label)))) + (draw-label (signal-ref mouse-label)))) (with-window (make-window #:title "Fonts") (run-game-loop)) |