Trait zng_view::extensions::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§