From 467e3343bc1620157073ff88b4990f39a60e3365 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Wed, 29 Jun 2022 08:11:40 -0500 Subject: [example] transparent texture, [modify] render transparent textures --- examples/02-moving-bitmp.lisp | 8 +++++--- examples/GelatinousCube.png | Bin 0 -> 3939 bytes wheelwork.lisp | 7 +++++-- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100755 examples/GelatinousCube.png diff --git a/examples/02-moving-bitmp.lisp b/examples/02-moving-bitmp.lisp index a1c3c87..9504a87 100644 --- a/examples/02-moving-bitmp.lisp +++ b/examples/02-moving-bitmp.lisp @@ -106,7 +106,7 @@ :texture (ww::get-asset "Fezghoul.png"))) (bm2 (make-instance 'ww::bitmap - :texture (ww::get-asset "RootBear.png")))) + :texture (ww::get-asset "GelatinousCube.png")))) (ww::add-handler app #'wheelie) @@ -115,7 +115,7 @@ (ww::add-handler bm #'animate-move-thing ) (ww::add-handler bm #'thing-clicked) (ww::add-handler bm #'mouse-over) - (ww::add-unit app bm) + ;;second (setf (ww::unit-x bm2) 90 (ww::unit-y bm2) 90) @@ -124,7 +124,9 @@ (ww::add-handler bm2 #'look-at-me) (ww::add-handler bm2 #'look-away) (ww::add-handler bm2 #'wheelie) - (ww::add-unit app bm2))) + + (ww::add-unit app bm2) + (ww::add-unit app bm))) (defun start () diff --git a/examples/GelatinousCube.png b/examples/GelatinousCube.png new file mode 100755 index 0000000..76d9c76 Binary files /dev/null and b/examples/GelatinousCube.png differ diff --git a/wheelwork.lisp b/wheelwork.lisp index 55996b1..25b4695 100644 --- a/wheelwork.lisp +++ b/wheelwork.lisp @@ -312,7 +312,7 @@ necessary." (sdl2:with-gl-context (ctx window) (sdl2:gl-make-current window ctx) (gl:viewport 0 0 (application-width app) (application-height app)) - (gl:enable :depth-test) + ;(gl:enable :depth-test) (let ((*application* app)) (unwind-protect (progn @@ -334,7 +334,10 @@ necessary." (defmethod render ((app application)) (run-perframe app) (gl:clear-color 0.0 0.0 0.0 1.0) - (gl:clear :depth-buffer-bit :color-buffer-bit) + ;(gl:clear :depth-buffer-bit :color-buffer-bit) + (gl:clear :color-buffer-bit) + (gl:enable :blend) + (gl:blend-func :src-alpha :one-minus-src-alpha ) (dolist (thing (container-units app)) (render thing)) (sdl2:gl-swap-window (application-window app)) -- cgit v1.2.3