zng_view::extensions

Trait OpenGlContext

Source
pub trait OpenGlContext {
    // Required methods
    fn is_current(&self) -> bool;
    fn make_current(&mut self);
    fn gl(&self) -> &Rc<dyn Gl>;
    fn render_mode(&self) -> RenderMode;
    fn resize(&mut self, size: PxSize);
    fn is_software(&self) -> bool;
    fn swap_buffers(&mut self);
}
Expand description

Represents a managed OpenGL context connected to a window or headless surface.

Required Methods§

Source

fn is_current(&self) -> bool

Context is current on the calling thread.

Source

fn make_current(&mut self)

Make context current on the calling thread.

Source

fn gl(&self) -> &Rc<dyn Gl>

The context.

Source

fn render_mode(&self) -> RenderMode

Actual render mode used to create the context.

Source

fn resize(&mut self, size: PxSize)

Resize surface.

Source

fn is_software(&self) -> bool

If the context runs on the CPU, not a GPU.

Source

fn swap_buffers(&mut self)

Swap buffers if the context is double-buffered.

Implementors§