Type Definition glutin::WindowedContext

source ·
pub type WindowedContext<T> = ContextWrapper<T, Window>;
Expand description

Represents an OpenGL Context and the Window with which it is associated.

Please see ContextWrapper<T, Window>.

Example

let mut el = glutin::event_loop::EventLoop::new();
let wb = glutin::window::WindowBuilder::new();
let windowed_context = glutin::ContextBuilder::new()
    .build_windowed(wb, &el)
    .unwrap();

let windowed_context = unsafe { windowed_context.make_current().unwrap() };

Implementations§

source§

impl<T: ContextCurrentState> WindowedContext<T>

source

pub fn window(&self) -> &Window

Borrow the inner W.

source

pub unsafe fn split(self) -> (RawContext<T>, Window)

Split the Window apart from the OpenGL Context. Should only be used when intending to transfer the RawContext<T> to another thread.

Unsaftey: