Struct glutin::Context

source ·
pub struct Context { /* private fields */ }
Expand description

Represents an OpenGL context.

A Context is normally associated with a single Window, however Contexts can be shared between multiple windows.

Example

let context = glutin::ContextBuilder::new()
    .with_vsync(true)
    .with_multisampling(8)
    .with_shared_lists(some_gl_window.context());

Trait Implementations§

source§

impl GlContext for Context

source§

unsafe fn make_current(&self) -> Result<(), ContextError>

Sets the context as the current context.
source§

fn is_current(&self) -> bool

Returns true if this context is the current one in this thread.
source§

fn get_proc_address(&self, addr: &str) -> *const ()

Returns the address of an OpenGL function.
source§

fn swap_buffers(&self) -> Result<(), ContextError>

Swaps the buffers in case of double or triple buffering. Read more
source§

fn get_api(&self) -> Api

Returns the OpenGL API being used.
source§

fn get_pixel_format(&self) -> PixelFormat

Returns the pixel format of the main framebuffer of the context.
source§

fn resize(&self, width: u32, height: u32)

Resize the GL context. Read more
source§

impl GlContextExt for Context

§

type Handle = RawHandle

Raw context handle.
source§

unsafe fn raw_handle(&self) -> Self::Handle

Returns the raw context handle.

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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.
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.
source§

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

Performs the conversion.