[][src]Type Definition glutin::WindowedContext

type WindowedContext<T> = ContextWrapper<T, Window>;

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

Please see ContextWrapper<T, Window>.

Example

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

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

loop {
    el.poll_events(|event| {
        match event {
            // process events here
            _ => (),
        }
    });

    // draw everything here

    windowed_context.swap_buffers();
    std::thread::sleep(std::time::Duration::from_millis(17));
}

Methods

impl<T: ContextCurrentState> WindowedContext<T>[src]

pub fn window(&self) -> &Window[src]

Borrow the inner W.

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

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

Unsaftey: