Struct glfw_window::GlfwWindow [] [src]

pub struct GlfwWindow {
    pub window: Window,
    pub glfw: Glfw,
    // some fields omitted
}

Contains stuff for game window.

Fields

window: Window

The window.

glfw: Glfw

GLFW context.

Methods

impl GlfwWindow
[src]

fn from_pieces(win: Window, glfw: Glfw, events: Receiver<(f64, WindowEvent)>, exit_on_esc: bool) -> GlfwWindow

Create a new game window from an existing GLFW window.

fn new(settings: WindowSettings) -> Result<GlfwWindowString>

Creates a new game window for GLFW.

Trait Implementations

impl BuildFromWindowSettings for GlfwWindow
[src]

fn build_from_window_settings(settings: WindowSettings) -> Result<GlfwWindowString>

Builds window from window settings.

impl Window for GlfwWindow
[src]

type Event = Input

The event type emitted by poll_event

fn size(&self) -> Size

Gets the size of the window in user coordinates.

fn draw_size(&self) -> Size

Gets draw size of the window. This is equal to the size of the frame buffer of the inner window, excluding the title bar and borders. Read more

fn set_should_close(&mut self, value: bool)

Tells the window to close or stay open.

fn should_close(&self) -> bool

Returns true if window should close.

fn swap_buffers(&mut self)

Swaps render buffers.

fn poll_event(&mut self) -> Option<Input>

Polls event from window.

impl AdvancedWindow for GlfwWindow
[src]

fn get_title(&self) -> String

Gets a copy of the title of the window.

fn set_title(&mut self, value: String)

Sets the title of the window.

fn get_exit_on_esc(&self) -> bool

Gets whether to exit when pressing esc.

fn set_exit_on_esc(&mut self, value: bool)

Sets whether to exit when pressing esc.

fn set_capture_cursor(&mut self, value: bool)

Sets whether to capture/grab cursor. This is used to lock and hide cursor to the window, for example in a first-person shooter game. Read more

fn title(self, value: String) -> Self

Sets title on window.

fn exit_on_esc(self, value: bool) -> Self

Sets whether to exit when pressing esc.

fn capture_cursor(self, value: bool) -> Self

Sets whether to capture/grab cursor (see set_capture_cursor).

impl OpenGLWindow for GlfwWindow
[src]

fn get_proc_address(&mut self, proc_name: &str) -> ProcAddress

Returns the address of an OpenGL function if it exist, else returns null pointer.

fn is_current(&self) -> bool

Returns true if this context is the current context.

fn make_current(&mut self)

Make this context current.