pub struct Context { /* private fields */ }
Expand description
Represents an OpenGL context.
A Context
is normally associated with a single Window, however Context
s can be shared
between multiple windows.
Example
let context = glutin::ContextBuilder::new()
.with_vsync(true)
.with_multisampling(8)
.with_shared_lists(some_gl_window.context());
Trait Implementations§
source§impl GlContext for Context
impl GlContext for Context
source§unsafe fn make_current(&self) -> Result<(), ContextError>
unsafe fn make_current(&self) -> Result<(), ContextError>
Sets the context as the current context.
source§fn is_current(&self) -> bool
fn is_current(&self) -> bool
Returns true if this context is the current one in this thread.
source§fn get_proc_address(&self, addr: &str) -> *const ()
fn get_proc_address(&self, addr: &str) -> *const ()
Returns the address of an OpenGL function.
source§fn swap_buffers(&self) -> Result<(), ContextError>
fn swap_buffers(&self) -> Result<(), ContextError>
Swaps the buffers in case of double or triple buffering. Read more
source§fn get_pixel_format(&self) -> PixelFormat
fn get_pixel_format(&self) -> PixelFormat
Returns the pixel format of the main framebuffer of the context.
Auto Trait Implementations§
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more