aboutsummaryrefslogtreecommitdiff
path: root/src/custom_elements.h
diff options
context:
space:
mode:
authorspl3g <spleefer6@yandex.ru>2025-11-09 20:43:50 +0300
committerspl3g <spleefer6@yandex.ru>2025-11-09 20:43:50 +0300
commitfc326115fa154bc19f3f10d7c2c4e57710ef1e0d (patch)
tree53ea067805d79d578a258fb0c347aa1525ab2dc2 /src/custom_elements.h
parent11e5f50717af85f775491a5d2a2867a7e0f9c45f (diff)
Move to sokol (broke the wave screen)
Diffstat (limited to 'src/custom_elements.h')
-rw-r--r--src/custom_elements.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/custom_elements.h b/src/custom_elements.h
new file mode 100644
index 0000000..cd36b6a
--- /dev/null
+++ b/src/custom_elements.h
@@ -0,0 +1,32 @@
+#ifndef CUSTOM_ELEMENTS_H_
+#define CUSTOM_ELEMENTS_H_
+
+#include "clay.h"
+
+typedef enum {
+ CUSTOM_ELEMENT_TYPE_CIRCLE,
+ CUSTOM_ELEMENT_TYPE_WAVE_SCREEN,
+} CustomElementType;
+
+typedef struct {
+ float start_angle;
+ float value;
+} CircleData;
+
+typedef struct {
+ float *point_buffer;
+ size_t buffer_len;
+} WaveScreenData;
+
+typedef struct {
+ CustomElementType type;
+
+ union {
+ CircleData circle;
+ WaveScreenData wave_screen;
+ };
+} CustomElementData;
+
+void handle_custom(Clay_BoundingBox bbox, Clay_CustomRenderData *config);
+
+#endif // CUSTOM_ELEMENTS_H_