Struct bgfx::Bgfx [] [src]

pub struct Bgfx {
    // some fields omitted
}

Acts as the library wrapper for bgfx. Any calls intended to be run on the main thread are exposed as functions on this object.

It is created through a call to bgfx::init, and will shut down bgfx when dropped.

Methods

impl Bgfx

fn dbg_text_clear(&self, attr: Option<u8>, small: Option<bool>)

Clears the debug text overlay.

fn dbg_text_image(&self, x: u16, y: u16, width: u16, height: u16, data: &[u8], pitch: u16)

Draws an image to the debug text overlay.

fn dbg_text_print(&self, x: u16, y: u16, attr: u8, text: &str)

Displays text in the debug text overlay.

fn frame(&self) -> u32

Finish the frame, syncing up with the render thread. Returns an incrementing frame counter.

fn get_renderer_type(&self) -> RendererType

Gets the type of the renderer in use.

fn reset(&self, width: u16, height: u16, reset: ResetFlags)

Resets the graphics device to the given size, with the given flags.

fn set_debug(&self, debug: DebugFlags)

Sets the debug flags to use.

fn set_index_buffer(&self, ibh: &IndexBuffer)

Sets the index buffer to use for rendering.

fn set_state(&self, state: StateFlags, rgba: Option<u32>)

Sets the render state.

fn set_transform(&self, mtx: &[f32; 16])

Sets the model transform for rendering. If not called before submitting a draw, an identity matrix will be used.

fn set_vertex_buffer(&self, vbh: &VertexBuffer)

Sets the vertex buffer to use for rendering.

fn set_view_clear(&self, id: u8, flags: ClearFlags, rgba: u32, depth: f32, stencil: u8)

Sets the options to use when clearing the given view.

fn set_view_rect(&self, id: u8, x: u16, y: u16, width: u16, height: u16)

Sets the rectangle to display the given view in.

fn set_view_transform(&self, id: u8, view: &[f32; 16], proj: &[f32; 16])

Sets the view and projection matrices for the given view.

fn submit(&self, view: u8, program: &Program) -> u32

Submit a primitive for rendering. Returns the number of draw calls used.

fn touch(&self, id: u8)

Touches a view. ( ͡° ͜ʖ ͡°)

Trait Implementations

impl Drop for Bgfx

fn drop(&mut self)