From eb47d92099299af62c05a0e13de955b205a99426 Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Thu, 19 Sep 2024 16:11:58 +0200 Subject: [PATCH] Added quad rendering and a (WIP) button type. --- assets/bitmaps/button.png | Bin 0 -> 849 bytes assets/bitmaps/ui_elements.txt | 2 +- private/sdl_gpu_test/6_ui/app.cpp | 5 + private/sdl_gpu_test/6_ui/app.hpp | 4 +- private/sdl_gpu_test/SModule | 1 + private/sdl_gpu_test/gui/button.cpp | 93 ++++++++++++++++++ private/sdl_gpu_test/gui/button.hpp | 68 +++++++++++++ private/sdl_gpu_test/gui/ui_renderer.cpp | 118 +++++++++++++++++++++-- private/sdl_gpu_test/gui/ui_renderer.hpp | 21 +++- 9 files changed, 300 insertions(+), 12 deletions(-) create mode 100644 assets/bitmaps/button.png create mode 100644 private/sdl_gpu_test/gui/button.cpp create mode 100644 private/sdl_gpu_test/gui/button.hpp diff --git a/assets/bitmaps/button.png b/assets/bitmaps/button.png new file mode 100644 index 0000000000000000000000000000000000000000..10a31f18f7cce0b886273cac0bab176e6ce177f8 GIT binary patch literal 849 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5LO9rfWUkapW1v85rn7T^r?ay{K~a8MW=<*t zgT}<#iMAex9b}Hi2QSsq<$Jr}(S(IoHxKe3*%-2sL(D6BVJQ1#@BIrrohLndq_IOx z=1;^Ls~r}vUp>&`Xp&br$LH6j7xd`=B&Y5O{=VNI-`#usPFBH0%g3~OQNyZ8H!V5g z%{xOce($Pd5joND}R5-+fJ%J0vedH;O2sAw< zzDZAe&UTB{Q>C)+PTqfE{`Ig+G0QExET&Cx5K>CH65z%vrnDt%$qbK+b!)ook9<@= zsXBQzk6RyW$U>*0KM(3Z?2g`SVEa_cx#2VU8~ zSMw&koBX9Jnp>W+`SyXMrO}hWH=LGDc;Pvn=j6maCaq44750nsPca^hPDnWWcJ0>w z%j^oyvAXve*xL_OOx$#R_nzJBH*c>$zvb6&#=Fc#7rFSHYk={>mgMd3!tfsi7wla= z87RV8;1OBOz`&mf!i+2ImuCV6*-JcqUD;o73iHYsY~&1o3lx$pag8W(&d<$F%`0JW zE=o--Nlj5G&n(GMaQE~L2yf&Q2gbLCr;B4q#jUq@4EYW#@Hhmv5#9FVii-mUwgrMSoN5GO+nBQP1VFbFU>fYKus7z?Hd&7AqZ{o1U~182Y9 zn+r0PICH;!*ed+t`WuOs%ImUq^`Z?O9P{~~t@+~~%lIHcUpq{@)BaVCC@^3dJYD@< J);T3K0RR#qDOmsj literal 0 HcmV?d00001 diff --git a/assets/bitmaps/ui_elements.txt b/assets/bitmaps/ui_elements.txt index 9edcebc..34cba6f 100644 --- a/assets/bitmaps/ui_elements.txt +++ b/assets/bitmaps/ui_elements.txt @@ -1,2 +1,2 @@ symtex_glyphs ../fonts/symtex.png -sdl_logo sdl.png \ No newline at end of file +button button.png \ No newline at end of file diff --git a/private/sdl_gpu_test/6_ui/app.cpp b/private/sdl_gpu_test/6_ui/app.cpp index 6958704..a6802fe 100644 --- a/private/sdl_gpu_test/6_ui/app.cpp +++ b/private/sdl_gpu_test/6_ui/app.cpp @@ -78,6 +78,11 @@ void UIApp::init(const AppInitArgs& args) .posX = 100, .posY = 100 }); + mButton = mWidgetTree.getRootWidget().emplaceChild