Backend

Trait Backend 

Source
pub unsafe trait Backend {
    // Required methods
    fn swap_buffers(&self) -> Result<(), SwapBuffersError>;
    unsafe fn get_proc_address(&self, symbol: &str) -> *const c_void;
    fn get_framebuffer_dimensions(&self) -> (u32, u32);
    fn resize(&self, new_size: (u32, u32));
    fn is_current(&self) -> bool;
    unsafe fn make_current(&self);
}
Expand description

Trait for types that can be used as a backend for a glium context.

This trait is unsafe, as you can get undefined behaviors or crashes if you don’t implement the methods correctly.

Required Methods§

Source

fn swap_buffers(&self) -> Result<(), SwapBuffersError>

Swaps buffers at the end of a frame.

Source

unsafe fn get_proc_address(&self, symbol: &str) -> *const c_void

Returns the address of an OpenGL function.

Supposes that the context has been made current before this function is called.

Source

fn get_framebuffer_dimensions(&self) -> (u32, u32)

Returns the dimensions of the window, or screen, etc.

Source

fn resize(&self, new_size: (u32, u32))

Resizes the underlying surface, should be called when the window’s size has changed for example.

Source

fn is_current(&self) -> bool

Returns true if the OpenGL context is the current one in the thread.

Source

unsafe fn make_current(&self)

Makes the OpenGL context the current context in the current thread.

Implementations on Foreign Types§

Source§

impl<T> Backend for Rc<T>
where T: Backend,

Source§

fn swap_buffers(&self) -> Result<(), SwapBuffersError>

Source§

unsafe fn get_proc_address(&self, symbol: &str) -> *const c_void

Source§

fn get_framebuffer_dimensions(&self) -> (u32, u32)

Source§

fn resize(&self, new_size: (u32, u32))

Source§

fn is_current(&self) -> bool

Source§

unsafe fn make_current(&self)

Implementors§