Enum OpenGLContextOwnership
#[non_exhaustive]pub enum OpenGLContextOwnership {
Shared,
Dedicated,
Unknown(u32),
}Expand description
How a session’s OpenGL context relates to the thread that attached it.
A shared session leaves the thread as it found it: every render makes the session context current and restores whatever was current before. The session context joins the host share group the descriptor names, so a host may hand the session a texture and sample it from its own context.
A dedicated session owns the thread. It makes its context current once and keeps it current between renders, and it joins no share group. Use this when a thread exists to drive one render session and runs no other graphics work.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
The session shares its thread with host graphics work.
Dedicated
The session owns its thread’s OpenGL context.
Unknown(u32)
Implementations§
§impl OpenGLContextOwnership
impl OpenGLContextOwnership
pub fn from_raw(raw: u32) -> OpenGLContextOwnership
pub fn as_raw(self) -> u32
Trait Implementations§
§impl Clone for OpenGLContextOwnership
impl Clone for OpenGLContextOwnership
§fn clone(&self) -> OpenGLContextOwnership
fn clone(&self) -> OpenGLContextOwnership
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for OpenGLContextOwnership
impl Debug for OpenGLContextOwnership
§impl Default for OpenGLContextOwnership
impl Default for OpenGLContextOwnership
§fn default() -> OpenGLContextOwnership
fn default() -> OpenGLContextOwnership
Returns the “default value” for a type. Read more
§impl Hash for OpenGLContextOwnership
impl Hash for OpenGLContextOwnership
§impl PartialEq for OpenGLContextOwnership
impl PartialEq for OpenGLContextOwnership
impl Copy for OpenGLContextOwnership
impl Eq for OpenGLContextOwnership
impl StructuralPartialEq for OpenGLContextOwnership
Auto Trait Implementations§
impl Freeze for OpenGLContextOwnership
impl RefUnwindSafe for OpenGLContextOwnership
impl Send for OpenGLContextOwnership
impl Sync for OpenGLContextOwnership
impl Unpin for OpenGLContextOwnership
impl UnsafeUnpin for OpenGLContextOwnership
impl UnwindSafe for OpenGLContextOwnership
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