Struct glutin_window::GlutinWindow
source · pub struct GlutinWindow {
pub ctx: PossiblyCurrentContext,
pub surface: Surface<WindowSurface>,
pub display: Display,
pub window: Window,
/* private fields */
}
Expand description
Contains stuff for game window.
Fields§
§ctx: PossiblyCurrentContext
The OpenGL context.
surface: Surface<WindowSurface>
The window surface.
display: Display
The graphics display.
window: Window
The window.
Implementations§
source§impl GlutinWindow
impl GlutinWindow
sourcepub fn new(settings: &WindowSettings) -> Result<Self, Box<dyn Error>>
pub fn new(settings: &WindowSettings) -> Result<Self, Box<dyn Error>>
Creates a new game window for Glutin.
Examples found in repository?
More examples
sourcepub fn from_raw(
settings: &WindowSettings,
event_loop: EventLoop<UserEvent>,
window_builder: WindowBuilder
) -> Result<Self, Box<dyn Error>>
pub fn from_raw( settings: &WindowSettings, event_loop: EventLoop<UserEvent>, window_builder: WindowBuilder ) -> Result<Self, Box<dyn Error>>
Creates a game window from a pre-existing Glutin event loop and window builder.
Trait Implementations§
source§impl AdvancedWindow for GlutinWindow
impl AdvancedWindow for GlutinWindow
source§fn get_exit_on_esc(&self) -> bool
fn get_exit_on_esc(&self) -> bool
Gets whether to exit when pressing esc. Read more
source§fn set_exit_on_esc(&mut self, value: bool)
fn set_exit_on_esc(&mut self, value: bool)
Sets whether to exit when pressing esc. Read more
source§fn get_automatic_close(&self) -> bool
fn get_automatic_close(&self) -> bool
Gets whether the window will automatically close when attempting
to close it. Read more
source§fn set_automatic_close(&mut self, value: bool)
fn set_automatic_close(&mut self, value: bool)
Sets whether the window will automatically close when attempting
to close it. If this is disabled, attempts to close the window
can be detected via an
Input::Close(..)
event, and
Window::set_should_close()
can be called to actually close the window. Read moresource§fn set_capture_cursor(&mut self, value: bool)
fn set_capture_cursor(&mut self, value: bool)
Sets whether to capture/grab the cursor. Read more
source§fn get_position(&self) -> Option<Position>
fn get_position(&self) -> Option<Position>
Gets the position of window.
source§fn exit_on_esc(self, value: bool) -> Self
fn exit_on_esc(self, value: bool) -> Self
Sets whether to exit when pressing the Esc button. Read more
source§fn automatic_close(self, value: bool) -> Self
fn automatic_close(self, value: bool) -> Self
Sets whether the window will automatically close when attempting
to close it. If this is disabled, attempts to close the window
can be detected via an
Input::Close(..)
event, and
Window::set_should_close()
can be called to actually close the window. Read moresource§fn capture_cursor(self, value: bool) -> Self
fn capture_cursor(self, value: bool) -> Self
Sets whether to capture/grab the cursor. Read more
source§impl BuildFromWindowSettings for GlutinWindow
impl BuildFromWindowSettings for GlutinWindow
source§fn build_from_window_settings(
settings: &WindowSettings
) -> Result<Self, Box<dyn Error>>
fn build_from_window_settings( settings: &WindowSettings ) -> Result<Self, Box<dyn Error>>
Builds the window from a
WindowSettings
object. Read moresource§impl OpenGLWindow for GlutinWindow
impl OpenGLWindow for GlutinWindow
source§fn get_proc_address(&mut self, proc_name: &str) -> ProcAddress
fn get_proc_address(&mut self, proc_name: &str) -> ProcAddress
Returns the address of the specified OpenGL function if it exists. Read more
source§fn is_current(&self) -> bool
fn is_current(&self) -> bool
Returns true if this window’s gl context is the current gl context.
source§fn make_current(&mut self)
fn make_current(&mut self)
Make the window’s gl context the current gl context.
source§impl Window for GlutinWindow
impl Window for GlutinWindow
source§fn should_close(&self) -> bool
fn should_close(&self) -> bool
Returns true if the window should close.
source§fn set_should_close(&mut self, value: bool)
fn set_should_close(&mut self, value: bool)
Tells the window to close or stay open.
source§fn swap_buffers(&mut self)
fn swap_buffers(&mut self)
Swaps render buffers. Read more
source§fn wait_event(&mut self) -> Event
fn wait_event(&mut self) -> Event
Wait indefinitely for an input event to be available from the window.
Auto Trait Implementations§
impl !RefUnwindSafe for GlutinWindow
impl !Send for GlutinWindow
impl !Sync for GlutinWindow
impl Unpin for GlutinWindow
impl !UnwindSafe for GlutinWindow
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more