Revert "Death to C++"

This reverts commit 066ac22605.
This commit is contained in:
2026-03-11 19:15:36 -04:00
parent 066ac22605
commit 13f856cfbc
80 changed files with 39269 additions and 5672 deletions

View File

@@ -14,14 +14,14 @@ typedef Vec2F32 (*UI_MeasureTextFn)(const char *text, S32 length, F32 font_size,
////////////////////////////////
// UI Context
typedef struct UI_Context {
struct UI_Context {
Clay_Context *clay_ctx;
void *clay_memory;
// Text measurement
UI_MeasureTextFn measure_text_fn;
void *measure_text_user_data;
} UI_Context;
};
////////////////////////////////
// Lifecycle
@@ -48,7 +48,7 @@ Vec2F32 ui_measure_text(const char *text, S32 length, F32 font_size);
////////////////////////////////
// Theme colors (convenience - 0-255 Clay_Color)
typedef struct UI_Theme {
struct UI_Theme {
Clay_Color bg_dark;
Clay_Color bg_medium;
Clay_Color bg_light;
@@ -76,7 +76,7 @@ typedef struct UI_Theme {
// Corner radius (unscaled pixels, applied via uis())
F32 corner_radius;
} UI_Theme;
};
extern UI_Theme g_theme;
extern S32 g_theme_id;
@@ -116,30 +116,30 @@ static inline U16 uifs(F32 x) { return (U16)(x * g_ui_scale + 0.5f); }
////////////////////////////////
// Custom render types (for gradient rects via CLAY_RENDER_COMMAND_TYPE_CUSTOM)
typedef enum CustomRenderType {
enum CustomRenderType {
CUSTOM_RENDER_VGRADIENT = 1,
CUSTOM_RENDER_ICON = 2,
CUSTOM_RENDER_ROTATED_ICON = 3,
} CustomRenderType;
};
typedef struct CustomGradientData {
struct CustomGradientData {
CustomRenderType type;
Clay_Color top_color;
Clay_Color bottom_color;
} CustomGradientData;
};
typedef struct CustomIconData {
struct CustomIconData {
CustomRenderType type; // CUSTOM_RENDER_ICON
S32 icon_id;
Clay_Color color;
} CustomIconData;
};
typedef struct CustomRotatedIconData {
struct CustomRotatedIconData {
CustomRenderType type; // CUSTOM_RENDER_ROTATED_ICON
S32 icon_id;
Clay_Color color;
F32 angle_rad;
} CustomRotatedIconData;
};
////////////////////////////////
// Font sizes