v / vlib / sokol / sfons / sfons_funcs.c.v
26 lines · 21 sloc · 750 bytes · be5f14a17085b766d34320b2a66aac794239f658
Raw
1module sfons
2
3import fontstash
4import sokol.memory
5
6@[typedef]
7pub struct C.sfons_allocator_t {
8pub:
9 alloc_fn memory.FnAllocatorAlloc = unsafe { nil }
10 free_fn memory.FnAllocatorFree = unsafe { nil }
11 user_data voidptr
12}
13
14@[typedef]
15pub struct C.sfons_desc_t {
16pub:
17 width int // initial width of font atlas texture (default: 512, must be power of 2)
18 height int // initial height of font atlas texture (default: 512, must be power of 2)
19 allocator C.sfons_allocator_t // optional memory allocation overrides
20}
21
22fn C.sfons_create(const_desc &C.sfons_desc_t) &fontstash.Context
23fn C.sfons_destroy(ctx &fontstash.Context)
24fn C.sfons_flush(ctx &fontstash.Context)
25
26fn C.sfons_rgba(r u8, g u8, b u8, a u8) u32
27