From 8d2793e9ef7cf7f742ec23e77c44ac21a624d01f Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Wed, 13 May 2026 21:24:21 -0400 Subject: start ui --- teensy/teensy_ui.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 teensy/teensy_ui.h (limited to 'teensy/teensy_ui.h') diff --git a/teensy/teensy_ui.h b/teensy/teensy_ui.h new file mode 100644 index 0000000..9a1e33a --- /dev/null +++ b/teensy/teensy_ui.h @@ -0,0 +1,42 @@ +#ifndef TEENSY_UI_H_ +#define TEENSY_UI_H_ + +#include "teensy_common.h" +#include "teensy.h" + +#define TYUI_WIN_NORESIZE (1 << 0) +#define TYUI_WIN_NOCLOSE (1 << 1) +#define TYUI_WIN_NOMOVE (1 << 2) +#define TYUI_WIN_INVISIBLE (1 << 3) + +#define tyui_begin_window(title, rect, id) \ + tyui_begin_window_ex(title, rect, id, 0, NULL) + +typedef struct { + ty_Color fg_normal; + ty_Color bg_normal; + ty_Color fg_hover; + ty_Color bg_hover; + ty_Color win_bg; + ty_Color win_title; +} tyui_Style; + +typedef uint8_t tyui_Id; + +void tyui_init(const ty_Font *font); +void tyui_deinit(void); + +void tyui_draw(void); + +bool tyui_begin_window_ex( + const char *title, + ty_Recti rect, + tyui_Id *id, + uint32_t flags, + bool *closed +); +void tyui_end_window(void); + +void tyui_text(const char *text); + +#endif // TEENSY_UI_H_ -- cgit v1.3-2-g0d8e