pub struct EGLContext<B: Backend, N: NativeDisplay<B>> { /* private fields */ }
Expand description
EGL context for rendering
Implementations§
source§impl<B: Backend, N: NativeDisplay<B>> EGLContext<B, N>
impl<B: Backend, N: NativeDisplay<B>> EGLContext<B, N>
sourcepub fn new<L>(
native: N,
attributes: GlAttributes,
reqs: PixelFormatRequirements,
logger: L
) -> Result<EGLContext<B, N>>where
L: Into<Option<Logger>>,
pub fn new<L>(
native: N,
attributes: GlAttributes,
reqs: PixelFormatRequirements,
logger: L
) -> Result<EGLContext<B, N>>where
L: Into<Option<Logger>>,
Create a new EGLContext
from a given NativeDisplay
sourcepub fn create_surface(
&self,
args: N::Arguments
) -> Result<EGLSurface<B::Surface>>
pub fn create_surface(
&self,
args: N::Arguments
) -> Result<EGLSurface<B::Surface>>
Creates a surface for rendering
sourcepub unsafe fn get_proc_address(&self, symbol: &str) -> *const c_void
pub unsafe fn get_proc_address(&self, symbol: &str) -> *const c_void
Returns the address of an OpenGL function.
Supposes that the context has been made current before this function is called.
sourcepub fn is_current(&self) -> bool
pub fn is_current(&self) -> bool
Returns true if the OpenGL context is the current one in the thread.
sourcepub fn get_pixel_format(&self) -> PixelFormat
pub fn get_pixel_format(&self) -> PixelFormat
Returns the pixel format of the main framebuffer of the context.
sourcepub fn borrow(&self) -> Ref<'_, N>
pub fn borrow(&self) -> Ref<'_, N>
Borrow the underlying native display.
This follows the same semantics as std::cell:RefCell
.
Multiple read-only borrows are possible. Borrowing the
backend while there is a mutable reference will panic.
sourcepub fn borrow_mut(&self) -> RefMut<'_, N>
pub fn borrow_mut(&self) -> RefMut<'_, N>
Borrow the underlying native display mutably.
This follows the same semantics as std::cell:RefCell
.
Holding any other borrow while trying to borrow the backend
mutably will panic. Note that EGL will borrow the display
mutably during surface creation.