summaryrefslogtreecommitdiff
path: root/the-price-of-a-cup-of-coffee.lisp
diff options
context:
space:
mode:
authorBoutade <thegoofist@protonmail.com>2019-10-15 07:44:56 -0500
committerBoutade <thegoofist@protonmail.com>2019-10-15 07:44:56 -0500
commitcc5433fe7aab0b949dd4a54b7da3a12a2eccaf2c (patch)
tree7704cbb448d8be402965bd0ff06679f582cfe4aa /the-price-of-a-cup-of-coffee.lisp
parent3386b8b93a7567c94c6d746d0b5e539c3d1b9c52 (diff)
freeing textures
Diffstat (limited to 'the-price-of-a-cup-of-coffee.lisp')
-rw-r--r--the-price-of-a-cup-of-coffee.lisp40
1 files changed, 19 insertions, 21 deletions
diff --git a/the-price-of-a-cup-of-coffee.lisp b/the-price-of-a-cup-of-coffee.lisp
index f04908e..891d702 100644
--- a/the-price-of-a-cup-of-coffee.lisp
+++ b/the-price-of-a-cup-of-coffee.lisp
@@ -177,10 +177,7 @@
(defun boot-up (renderer)
-
(boot-up-assets renderer)
-
-
(setf *nance* (make-instance 'hero :sheet *nance-texture*)))
@@ -391,30 +388,31 @@
(defun start ()
;; (play-track *cold-day-track*)
+ (unwind-protect
+ (sdl2:with-init (:everything)
+ (sdl2:with-window (win :w 1024 :h 600 :title "The Price Of A Cup Of Coffee" :flags '(:shown))
+ (sdl2:with-renderer (renderer win :flags '(:accelerated))
- (sdl2:with-init (:everything)
- (sdl2:with-window (win :w 1024 :h 600 :title "The Price Of A Cup Of Coffee" :flags '(:shown))
- (sdl2:with-renderer (renderer win :flags '(:accelerated))
-
- (boot-up renderer)
+ (boot-up renderer)
- (sdl2:with-event-loop (:method :poll)
+ (sdl2:with-event-loop (:method :poll)
- (:keydown (:keysym keysym)
- (if (sdl2:scancode= (sdl2:scancode-value keysym) :scancode-escape)
- (sdl2:push-event :quit)
- (handle-keydown keysym)))
+ (:keydown (:keysym keysym)
+ (if (sdl2:scancode= (sdl2:scancode-value keysym) :scancode-escape)
+ (sdl2:push-event :quit)
+ (handle-keydown keysym)))
- (:keyup (:keysym keysym) (handle-keyup keysym))
+ (:keyup (:keysym keysym) (handle-keyup keysym))
- (:idle ()
- (update :game (sdl2:get-ticks))
- (render :game renderer)
+ (:idle ()
+ (update :game (sdl2:get-ticks))
+ (render :game renderer)
- (sdl2:delay +frame-delay+))
+ (sdl2:delay +frame-delay+))
- (:quit ()
-; (harmony-simple:stop *current-track*)
- t))))))
+ (:quit ()
+ ; (harmony-simple:stop *current-track*)
+ t)))))
+ (free-assets)))