Trait glfw::Context

source ·
pub trait Context {
    fn window_ptr(&self) -> *mut GLFWwindow;

    fn window_id(&self) -> WindowId { ... }
    fn swap_buffers(&mut self) { ... }
    fn is_current(&self) -> bool { ... }
    fn make_current(&mut self) { ... }
    fn should_close(&self) -> bool { ... }
    fn set_should_close(&mut self, value: bool) { ... }
    fn post_empty_event(&self) { ... }
}
Expand description

Methods common to renderable contexts

Required Methods§

Returns the pointer to the underlying GLFWwindow.

Provided Methods§

Returns the unique identifier for this window.

Swaps the front and back buffers of the window. If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers.

Wrapper for glfwSwapBuffers.

Returns true if the window is the current context.

Wrapper for glfwMakeContextCurrent

Examples found in repository?
src/lib.rs (line 1973)
1971
1972
1973
1974
1975
1976
1977
    pub fn get_proc_address(&mut self, procname: &str) -> GLProc {
        if self.ptr != unsafe { ffi::glfwGetCurrentContext() } {
            self.make_current();
        }

        self.glfw.get_proc_address_raw(procname)
    }

Wrapper for glfwWindowShouldClose.

Wrapper for glfwSetWindowShouldClose.

Wrapper for glfwPostEmptyEvent.

Implementors§