pub struct Context<T: ContextCurrentState> { /* 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 or be headless.
If a Context
is backed by a window, it will be wrapped by either
RawContext<T>
or WindowedContext<T>
.
Example
let cb = glutin::ContextBuilder::new()
.with_vsync(true)
.with_multisampling(8)
.with_shared_lists(some_context.context());
Implementations§
source§impl<T: ContextCurrentState> Context<T>
impl<T: ContextCurrentState> Context<T>
sourcepub unsafe fn make_current(
self
) -> Result<Context<PossiblyCurrent>, (Self, ContextError)>
pub unsafe fn make_current( self ) -> Result<Context<PossiblyCurrent>, (Self, ContextError)>
sourcepub unsafe fn make_not_current(
self
) -> Result<Context<NotCurrent>, (Self, ContextError)>
pub unsafe fn make_not_current( self ) -> Result<Context<NotCurrent>, (Self, ContextError)>
sourcepub unsafe fn treat_as_not_current(self) -> Context<NotCurrent>
pub unsafe fn treat_as_not_current(self) -> Context<NotCurrent>
sourcepub unsafe fn treat_as_current(self) -> Context<PossiblyCurrent>
pub unsafe fn treat_as_current(self) -> Context<PossiblyCurrent>
sourcepub fn is_current(&self) -> bool
pub fn is_current(&self) -> bool
source§impl Context<PossiblyCurrent>
impl Context<PossiblyCurrent>
sourcepub fn get_proc_address(&self, addr: &str) -> *const ()
pub fn get_proc_address(&self, addr: &str) -> *const ()
Trait Implementations§
source§impl<T: ContextCurrentState> ContextTraitExt for Context<T>
impl<T: ContextCurrentState> ContextTraitExt for Context<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Context<T>
impl<T> Send for Context<T>where T: Send,
impl<T> Sync for Context<T>where T: Sync,
impl<T> Unpin for Context<T>where T: Unpin,
impl<T> !UnwindSafe for Context<T>
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