Struct glutin::RawContext
source · pub struct RawContext { /* private fields */ }
Expand description
Represents a raw OpenGL context.
Implementations§
source§impl RawContext
impl RawContext
sourcepub fn swap_buffers(&self) -> Result<(), ContextError>
pub fn swap_buffers(&self) -> Result<(), ContextError>
Swaps the buffers in case of double or triple buffering.
You should call this function every time you have finished rendering, or the image may not be displayed on the screen.
Warning: if you enabled vsync, this function will block until the
next time the screen is refreshed. However drivers can choose to
override your vsync settings, which means that you can’t know in
advance whether swap_buffers
will block or not.
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 resize(&self, size: PhysicalSize)
pub fn resize(&self, size: PhysicalSize)
Resize the context.
Some platforms (macOS, Wayland) require being manually updated when their window or surface is resized.
The easiest way of doing this is to take every Resized
window event
that is received with a LogicalSize
and convert it to a
PhysicalSize
and pass it into this function.