summaryrefslogtreecommitdiff
path: root/examples/sprite-batch.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2020-11-18 17:23:29 -0500
committerDavid Thompson <dthompson2@worcester.edu>2020-11-18 17:23:29 -0500
commit683c6ea4b7572f82dda5b9371afc94108eef31de (patch)
treef3cbd90c61b5df801b2a33d069551983c8bc784a /examples/sprite-batch.scm
parentdafddcdb4c867f40b625c149345e4d3c3841f645 (diff)
examples: Replace calls to sdl-ticks with elapsed-time.
Diffstat (limited to 'examples/sprite-batch.scm')
-rw-r--r--examples/sprite-batch.scm8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/sprite-batch.scm b/examples/sprite-batch.scm
index d4cccb5..30d8167 100644
--- a/examples/sprite-batch.scm
+++ b/examples/sprite-batch.scm
@@ -3,19 +3,19 @@
(chickadee math rect)
(chickadee math vector)
(chickadee graphics)
+ (chickadee graphics color)
(chickadee graphics font)
(chickadee graphics sprite)
(chickadee graphics texture)
(chickadee scripting)
(ice-9 format)
(ice-9 match)
- ((sdl2) #:select (sdl-ticks))
(srfi srfi-1)
(statprof))
(define texture #f)
(define batch #f)
-(define start-time (sdl-ticks))
+(define start-time 0.0)
(define avg-frame-time 16)
(define num-sprites 5000)
(define sprites
@@ -54,8 +54,8 @@
(sprite-batch-add* batch r matrix)))
sprites)
(draw-sprite-batch batch)
- (draw-text stats-text stats-text-pos)
- (let ((current-time (sdl-ticks)))
+ (draw-text stats-text stats-text-pos #:color black)
+ (let ((current-time (elapsed-time)))
(set! avg-frame-time
(+ (* (- current-time start-time) 0.1)
(* avg-frame-time 0.9)))