2020-01-16 22:45:47 +03:00
|
|
|
module sfons
|
|
|
|
|
2021-12-06 23:39:43 +03:00
|
|
|
import fontstash
|
2023-01-11 12:29:38 +03:00
|
|
|
import sokol.memory
|
2021-12-06 23:39:43 +03:00
|
|
|
|
2023-01-11 12:29:38 +03:00
|
|
|
[typedef]
|
|
|
|
pub struct C.sfons_allocator_t {
|
|
|
|
pub:
|
|
|
|
alloc memory.FnAllocatorAlloc
|
|
|
|
free memory.FnAllocatorFree
|
|
|
|
user_data voidptr
|
|
|
|
}
|
|
|
|
|
|
|
|
[typedef]
|
|
|
|
pub struct C.sfons_desc_t {
|
|
|
|
pub:
|
|
|
|
width int // initial width of font atlas texture (default: 512, must be power of 2)
|
|
|
|
height int // initial height of font atlas texture (default: 512, must be power of 2)
|
|
|
|
allocator C.sfons_allocator_t // optional memory allocation overrides
|
|
|
|
}
|
|
|
|
|
|
|
|
fn C.sfons_create(desc &C.sfons_desc_t) &fontstash.Context
|
2021-12-06 23:39:43 +03:00
|
|
|
fn C.sfons_destroy(ctx &fontstash.Context)
|
|
|
|
fn C.sfons_flush(ctx &fontstash.Context)
|
2023-01-11 12:29:38 +03:00
|
|
|
|
|
|
|
fn C.sfons_rgba(r u8, g u8, b u8, a u8) u32
|