WIP: lunasvg implementation, things stopped working
This commit is contained in:
23
src/ui/ui_icons.h
Normal file
23
src/ui/ui_icons.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#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_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 R8 atlas bitmap.
|
||||
// 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);
|
||||
Reference in New Issue
Block a user