pub struct AdapterContext { /* private fields */ }
Available on (non-WebAssembly or crate feature emscripten) and crate feature gles only.
Expand description

A wrapper around a glow::Context and the required EGL context that uses locking to guarantee exclusive access when shared with multiple threads.

Implementations§

source§

impl AdapterContext

source

pub fn is_owned(&self) -> bool

source

pub fn egl_instance(&self) -> Option<&DynamicInstance<EGL1_4>>

Returns the EGL instance.

This provides access to EGL functions and the ability to load GL and EGL extension functions.

source

pub fn raw_display(&self) -> Option<&Display>

Returns the EGLDisplay corresponding to the adapter context.

Returns None if the adapter was externally created.

source

pub fn egl_version(&self) -> Option<(i32, i32)>

Returns the EGL version the adapter context was created with.

Returns None if the adapter was externally created.

source

pub fn raw_context(&self) -> *mut c_void

source§

impl AdapterContext

source

pub unsafe fn get_without_egl_lock(&self) -> MutexGuard<'_, Context>

Get’s the glow::Context without waiting for a lock

Safety

This should only be called when you have manually made sure that the current thread has made the EGL context current and that no other thread also has the EGL context current. Additionally, you must manually make the EGL context not current after you are done with it, so that future calls to lock() will not fail.

Note: Calling this function will still lock the glow::Context which adds an extra safe-guard against accidental concurrent access to the context.

source

pub fn lock<'a>(&'a self) -> AdapterContextLock<'a>

Obtain a lock to the EGL context and get handle to the glow::Context that can be used to do rendering.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>