pub struct Context { /* private fields */ }
Expand description
An OpenGL context.
A context encapsulates the OpenGL specific setup and state on a
window. Hence, conceptually a context is associated with a window,
but that does not have to be a winit
created one (and can also
include one not managed at the Rust level at all).
Implementations§
Source§impl Context
impl Context
Sourcepub fn new(
display: &Display,
config: &Config,
window: &WinitWindow,
) -> Result<Self>
pub fn new( display: &Display, config: &Config, window: &WinitWindow, ) -> Result<Self>
Create a new OpenGL context on the given window.
Sourcepub fn from_xlib_data(
display_handle: XlibDisplayHandle,
window_handle: XlibWindowHandle,
phys_w: NonZeroU32,
phys_h: NonZeroU32,
) -> Result<Self>
pub fn from_xlib_data( display_handle: XlibDisplayHandle, window_handle: XlibWindowHandle, phys_w: NonZeroU32, phys_h: NonZeroU32, ) -> Result<Self>
Create a new OpenGL context given some xlib display & window state.
Sourcepub fn on_resize(&mut self, phys_w: NonZeroU32, phys_h: NonZeroU32)
pub fn on_resize(&mut self, phys_w: NonZeroU32, phys_h: NonZeroU32)
Inform the surface that the window has been resized.
Sourcepub fn swap_buffers(&mut self)
pub fn swap_buffers(&mut self)
Swap the rendering buffers to activate the one that any rendering operations occurred on.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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