Trait HasContext

Source
pub trait HasContext: HasGLContext {
    // Required methods
    fn new(builder: &ContextBuilder) -> Self
       where Self: Sized;
    fn run(&mut self) -> bool;
    fn make_current(&self) -> Result<(), ContextError>;
    fn swap_buffers(&self) -> Result<(), ContextError>;
    fn get_proc_address(&self, addr: &str) -> *const ();
    fn inner_dimensions(&self) -> (usize, usize);
}
Expand description

A trait defining the GPUContext interface.

Required Methods§

Source

fn new(builder: &ContextBuilder) -> Self
where Self: Sized,

Creates a new Context.

Source

fn run(&mut self) -> bool

Runs the Context and returns false if the Context is no longer available.

Source

fn make_current(&self) -> Result<(), ContextError>

Makes the Context current for the current thread.

Source

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

Swap buffers for presenting in the ContextDisplay.

Source

fn get_proc_address(&self, addr: &str) -> *const ()

OpenGL function dynamic loading.

Source

fn inner_dimensions(&self) -> (usize, usize)

Gets the inner dimensions of the ContextDisplay.

Implementors§