pub enum PossiblyCurrentContext {
Egl(PossiblyCurrentContext),
Glx(PossiblyCurrentContext),
}
Expand description
A context that is possibly current on the current thread.
The context that could be current on the current thread can neither be
Send
nor Sync
. In case you need to use it on a different thread
make it not current.
ⓘ
fn test_send<T: Send>() {}
test_send::<glutin::context::PossiblyCurrentContext>();
ⓘ
fn test_sync<T: Sync>() {}
test_sync::<glutin::context::PossiblyCurrentContext>();
Variants§
Trait Implementations§
Source§impl AsRawContext for PossiblyCurrentContext
impl AsRawContext for PossiblyCurrentContext
Source§fn raw_context(&self) -> RawContext
fn raw_context(&self) -> RawContext
Get the raw context handle.
Source§impl Debug for PossiblyCurrentContext
impl Debug for PossiblyCurrentContext
Source§impl GetGlConfig for PossiblyCurrentContext
impl GetGlConfig for PossiblyCurrentContext
Source§impl GlContext for PossiblyCurrentContext
impl GlContext for PossiblyCurrentContext
Source§fn context_api(&self) -> ContextApi
fn context_api(&self) -> ContextApi
Get the
ContextApi
used by the context. Read moreSource§impl PossiblyCurrentGlContext for PossiblyCurrentContext
impl PossiblyCurrentGlContext for PossiblyCurrentContext
Source§type NotCurrentContext = NotCurrentContext
type NotCurrentContext = NotCurrentContext
The not current context type.
Source§type Surface<T: SurfaceTypeTrait> = Surface<T>
type Surface<T: SurfaceTypeTrait> = Surface<T>
The surface supported by the 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 make_not_current(self) -> Result<Self::NotCurrentContext>
fn make_not_current(self) -> Result<Self::NotCurrentContext>
Make the context not current to the current thread and returns a
Self::NotCurrentContext
to indicate that the context is a not
current to allow sending it to the different thread. Read moreSource§fn make_not_current_in_place(&self) -> Result<()>
fn make_not_current_in_place(&self) -> Result<()>
Make the context not current to the current thread. If you need to
send the context to another thread, use
Self::make_not_current
instead.Source§fn make_current<T: SurfaceTypeTrait>(
&self,
surface: &Self::Surface<T>,
) -> Result<()>
fn make_current<T: SurfaceTypeTrait>( &self, surface: &Self::Surface<T>, ) -> Result<()>
Make
Self::Surface
current on the calling thread. Read moreSource§fn make_current_draw_read<T: SurfaceTypeTrait>(
&self,
surface_draw: &Self::Surface<T>,
surface_read: &Self::Surface<T>,
) -> Result<()>
fn make_current_draw_read<T: SurfaceTypeTrait>( &self, surface_draw: &Self::Surface<T>, surface_read: &Self::Surface<T>, ) -> Result<()>
The same as
Self::make_current
but provides a way to set read and
draw surfaces explicitly. Read moreAuto Trait Implementations§
impl Freeze for PossiblyCurrentContext
impl RefUnwindSafe for PossiblyCurrentContext
impl !Send for PossiblyCurrentContext
impl !Sync for PossiblyCurrentContext
impl Unpin for PossiblyCurrentContext
impl UnwindSafe for PossiblyCurrentContext
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