Files
autosample/src/ui/ui_icons.h

27 lines
755 B
C

#pragma once
// ui_icons.h - SVG icon definitions and atlas rasterization via lunasvg
#include "base/base_inc.h"
enum UI_IconID {
UI_ICON_CLOSE,
UI_ICON_CHECK,
UI_ICON_CHEVRON_DOWN,
UI_ICON_KNOB,
UI_ICON_SLIDER_THUMB,
UI_ICON_FADER,
UI_ICON_COUNT
};
struct UI_IconInfo {
F32 u0, v0, u1, v1; // UV coordinates in icon atlas
F32 w, h; // pixel dimensions at rasterized size
};
extern UI_IconInfo g_icons[UI_ICON_COUNT];
// Rasterizes all icons into an RGBA8 atlas bitmap (4 bytes per pixel).
// Returns malloc'd data (caller frees). Sets *out_w, *out_h to atlas dimensions.
// icon_size is the pixel height to rasterize each icon at.
U8 *ui_icons_rasterize_atlas(S32 *out_w, S32 *out_h, S32 icon_size);