Trait fontstash::Renderer[][src]

pub unsafe trait Renderer {
    unsafe extern "C" fn create(
        uptr: *mut c_void,
        width: c_int,
        height: c_int
    ) -> c_int;
unsafe extern "C" fn resize(
        uptr: *mut c_void,
        width: c_int,
        height: c_int
    ) -> c_int;
unsafe extern "C" fn expand(uptr: *mut c_void) -> c_int;
unsafe extern "C" fn update(
        uptr: *mut c_void,
        rect: *mut c_int,
        data: *const c_uchar
    ) -> c_int; }

Set of callbacks

  • uptr: user data pointer, which is usually the implementation of Renderer

Return non-zero to represent success.

Required methods

unsafe extern "C" fn create(
    uptr: *mut c_void,
    width: c_int,
    height: c_int
) -> c_int
[src]

Creates font texture

unsafe extern "C" fn resize(
    uptr: *mut c_void,
    width: c_int,
    height: c_int
) -> c_int
[src]

Create new texture

User of Renderer should not call it directly; it’s used to implement FontStash::expand_atlas and FontStash::reset_atlas.

unsafe extern "C" fn expand(uptr: *mut c_void) -> c_int[src]

Try to expand texture while the atlas is full

unsafe extern "C" fn update(
    uptr: *mut c_void,
    rect: *mut c_int,
    data: *const c_uchar
) -> c_int
[src]

Update texture

Loading content...

Implementors

Loading content...