Death to C++
This commit is contained in:
@@ -14,14 +14,14 @@ typedef Vec2F32 (*UI_MeasureTextFn)(const char *text, S32 length, F32 font_size,
|
||||
////////////////////////////////
|
||||
// UI Context
|
||||
|
||||
struct UI_Context {
|
||||
typedef 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)
|
||||
|
||||
struct UI_Theme {
|
||||
typedef struct UI_Theme {
|
||||
Clay_Color bg_dark;
|
||||
Clay_Color bg_medium;
|
||||
Clay_Color bg_light;
|
||||
@@ -76,7 +76,7 @@ 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)
|
||||
|
||||
enum CustomRenderType {
|
||||
typedef enum CustomRenderType {
|
||||
CUSTOM_RENDER_VGRADIENT = 1,
|
||||
CUSTOM_RENDER_ICON = 2,
|
||||
CUSTOM_RENDER_ROTATED_ICON = 3,
|
||||
};
|
||||
} CustomRenderType;
|
||||
|
||||
struct CustomGradientData {
|
||||
typedef struct CustomGradientData {
|
||||
CustomRenderType type;
|
||||
Clay_Color top_color;
|
||||
Clay_Color bottom_color;
|
||||
};
|
||||
} CustomGradientData;
|
||||
|
||||
struct CustomIconData {
|
||||
typedef struct CustomIconData {
|
||||
CustomRenderType type; // CUSTOM_RENDER_ICON
|
||||
S32 icon_id;
|
||||
Clay_Color color;
|
||||
};
|
||||
} CustomIconData;
|
||||
|
||||
struct CustomRotatedIconData {
|
||||
typedef struct CustomRotatedIconData {
|
||||
CustomRenderType type; // CUSTOM_RENDER_ROTATED_ICON
|
||||
S32 icon_id;
|
||||
Clay_Color color;
|
||||
F32 angle_rad;
|
||||
};
|
||||
} CustomRotatedIconData;
|
||||
|
||||
////////////////////////////////
|
||||
// Font sizes
|
||||
|
||||
Reference in New Issue
Block a user