aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-06-22 10:12:23 -0500
committerColin Okay <colin@cicadas.surf>2022-06-22 10:12:23 -0500
commit0aa537c44cf6924f0a63453545ebdbad315c8c51 (patch)
treee5cedf3b061c2de0515985b87408d77d46c27b75
parenteb34cd2d8798ef144425c8b4f03b7e6d9efd7f08 (diff)
[fix] bug in ensure-loaded for textures
-rw-r--r--examples/02-moving-bitmp.lisp22
-rw-r--r--wheelwork.lisp2
2 files changed, 16 insertions, 8 deletions
diff --git a/examples/02-moving-bitmp.lisp b/examples/02-moving-bitmp.lisp
index e7faeac..425457b 100644
--- a/examples/02-moving-bitmp.lisp
+++ b/examples/02-moving-bitmp.lisp
@@ -9,21 +9,26 @@
(defclass bitmap-display (ww::application ) ())
(ww::defhandler move-thing
- (ww::on-keydown (target code mods)
+ (ww::on-keydown (unit code mods)
(case code
- (:scancode-left (decf (ww::unit-x target) (ww::unit-width target)))
- (:scancode-right (incf (ww::unit-x target) (ww::unit-width target)))
- (:scancode-down (decf (ww::unit-y target) (ww::unit-height target)))
- (:scancode-up (incf (ww::unit-y target) (ww::unit-height target)))
+ (:scancode-left (decf (ww::unit-x unit) (ww::unit-width unit)))
+ (:scancode-right (incf (ww::unit-x unit) (ww::unit-width unit)))
+ (:scancode-down (decf (ww::unit-y unit) (ww::unit-height unit)))
+ (:scancode-up (incf (ww::unit-y unit) (ww::unit-height unit)))
(:scancode-equals
- (print mods)))))
+ (when (or (member :lshift mods) (member :rshift mods))
+ (incf (ww::unit-height unit) 20.0)
+ (incf (ww::unit-width unit) 20.0)))
+ (:scancode-minus
+ (decf (ww::unit-height unit) 20.0)
+ (decf (ww::unit-width unit) 20.0)))))
(defmethod ww::boot ((app bitmap-display))
(let ((bm
(make-instance 'ww::bitmap
:texture (ww::get-asset "Fezghoul.png"))))
(ww::refocus-on bm)
- (ww::set-handler bm *move-thing*)
+ (ww::set-handler bm #'move-thing)
(ww::add-unit app bm)))
@@ -31,3 +36,6 @@
(ww::start (make-instance 'bitmap-display
:scale 3.0
:asset-root #P"~/projects/wheelwork/examples/")))
+
+
+(start)
diff --git a/wheelwork.lisp b/wheelwork.lisp
index ffa0005..fdeee48 100644
--- a/wheelwork.lisp
+++ b/wheelwork.lisp
@@ -202,7 +202,7 @@ order). Makes sure to remove the unit from its current container if necessary."
(gl:tex-parameter :texture-2d :texture-wrap-s wrap-s)
(gl:tex-parameter :texture-2d :texture-wrap-t wrap-t)
(gl:tex-parameter :texture-2d :texture-min-filter min-filter)
- (gl:tex-parameter :texture-2d :texture-min-filter mag-filter)
+ (gl:tex-parameter :texture-2d :texture-mag-filter mag-filter)
(gl:tex-image-2d :texture-2d
0
internal-format