pub trait Context {
// Required method
fn window_ptr(&self) -> *mut GLFWwindow;
// Provided methods
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§
sourcefn window_ptr(&self) -> *mut GLFWwindow
fn window_ptr(&self) -> *mut GLFWwindow
Returns the pointer to the underlying GLFWwindow
.
Provided Methods§
sourcefn swap_buffers(&mut self)
fn swap_buffers(&mut self)
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
.
sourcefn is_current(&self) -> bool
fn is_current(&self) -> bool
Returns true
if the window is the current context.
sourcefn make_current(&mut self)
fn make_current(&mut self)
Wrapper for glfwMakeContextCurrent
sourcefn should_close(&self) -> bool
fn should_close(&self) -> bool
Wrapper for glfwWindowShouldClose
.
sourcefn set_should_close(&mut self, value: bool)
fn set_should_close(&mut self, value: bool)
Wrapper for glfwSetWindowShouldClose
.
sourcefn post_empty_event(&self)
fn post_empty_event(&self)
Wrapper for glfwPostEmptyEvent
.