improve sw renderer

This commit is contained in:
asrael 2026-01-21 23:19:50 -06:00
parent 415d424057
commit 39ee0fefb7
89 changed files with 9380 additions and 2307 deletions

View file

@ -2,6 +2,7 @@
(local music (require :mod.music))
(var paused false)
(var wireframe false)
(var gui nil)
(fn init []
@ -37,18 +38,22 @@
(when gui
(gui:begin_frame)
(pxl8.gui_window 200 100 240 180 "pxl8 demo")
(pxl8.gui_window 200 100 240 200 "pxl8 demo")
(when (gui:button 1 215 145 210 32 "Resume")
(when (gui:button 1 215 147 210 30 "Resume")
(hide))
(let [music-label (if (music.is-playing) "Music: On" "Music: Off")]
(when (gui:button 3 215 185 210 32 music-label)
(when (gui:button 3 215 182 210 30 music-label)
(if (music.is-playing)
(music.stop)
(music.start))))
(when (gui:button 2 215 225 210 32 "Quit")
(let [wire-label (if wireframe "Wireframe: On" "Wireframe: Off")]
(when (gui:button 4 215 217 210 30 wire-label)
(set wireframe (not wireframe))))
(when (gui:button 2 215 252 210 30 "Quit")
(pxl8.quit))
(if (gui:is_hovering)
@ -58,6 +63,7 @@
(gui:end_frame)))
{:is-paused (fn [] paused)
:is-wireframe (fn [] wireframe)
:toggle toggle
:show show
:hide hide