Trait piston_window::OpenGLWindow[][src]

pub trait OpenGLWindow: Window {
    pub fn get_proc_address(&mut self, proc_name: &str) -> *const ();
pub fn is_current(&self) -> bool;
pub fn make_current(&mut self); }

Trait for OpenGL specific operations on a window.

OpenGL uses a strategy called “function pointer loading” to hook up the higher level graphics APIs with the OpenGL driver. Which function pointers to load depends on the hardware capabilities and version of OpenGL. By using the OpenGLWindow trait, the higher level graphics API can load functions from the window backend with the version set up using the WindowSettings structure.

For more information about function pointer loading, see https://www.opengl.org/wiki/Load_OpenGL_Functions

Required methods

pub fn get_proc_address(&mut self, proc_name: &str) -> *const ()[src]

Returns the address of the specified OpenGL function if it exists.

If the function does not exist, it returns a null pointer.

pub fn is_current(&self) -> bool[src]

Returns true if this window’s gl context is the current gl context.

pub fn make_current(&mut self)[src]

Make the window’s gl context the current gl context.

Loading content...

Implementations on Foreign Types

impl OpenGLWindow for GlutinWindow[src]

Loading content...

Implementors

Loading content...