Struct piston_window::NoWindow
[−]pub struct NoWindow { /* private fields */ }
Expand description
A window without user interface, often used in server event loops.
This structure holds just enough state to return values that were set.
The size can be changed because the event loop does not emit
Render
events when the width or height is zero.
Implementations
impl NoWindow
impl NoWindow
pub fn new(settings: &WindowSettings) -> NoWindow
pub fn new(settings: &WindowSettings) -> NoWindow
Creates a new NoWindow
.
Trait Implementations
impl AdvancedWindow for NoWindow
impl AdvancedWindow for NoWindow
pub fn get_exit_on_esc(&self) -> bool
pub fn get_exit_on_esc(&self) -> bool
Gets whether to exit when pressing esc. Read more
pub fn set_exit_on_esc(&mut self, _value: bool)
pub fn set_exit_on_esc(&mut self, _value: bool)
Sets whether to exit when pressing esc. Read more
pub fn get_automatic_close(&self) -> bool
pub fn get_automatic_close(&self) -> bool
Gets whether the window will automatically close when attempting to close it. Read more
pub fn set_automatic_close(&mut self, value: bool)
pub 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 more
pub fn set_capture_cursor(&mut self, _value: bool)
pub fn set_capture_cursor(&mut self, _value: bool)
Sets whether to capture/grab the cursor. Read more
pub fn get_position(&self) -> Option<Position>
pub fn get_position(&self) -> Option<Position>
Gets the position of window.
pub fn set_position<P>(&mut self, val: P) where
P: Into<Position>,
pub fn set_position<P>(&mut self, val: P) where
P: Into<Position>,
Sets the position of window. Read more
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
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 more
fn capture_cursor(self, value: bool) -> Self
fn capture_cursor(self, value: bool) -> Self
Sets whether to capture/grab the cursor. Read more
impl BuildFromWindowSettings for NoWindow
impl BuildFromWindowSettings for NoWindow
pub fn build_from_window_settings(
settings: &WindowSettings
) -> Result<NoWindow, Box<dyn Error + 'static, Global>>
pub fn build_from_window_settings(
settings: &WindowSettings
) -> Result<NoWindow, Box<dyn Error + 'static, Global>>
Errors
This function will always return without error.
impl Window for NoWindow
impl Window for NoWindow
pub fn set_should_close(&mut self, value: bool)
pub fn set_should_close(&mut self, value: bool)
Tells the window to close or stay open.
pub fn should_close(&self) -> bool
pub fn should_close(&self) -> bool
Returns true if the window should close.
pub fn swap_buffers(&mut self)
pub fn swap_buffers(&mut self)
Swaps render buffers. Read more
pub fn wait_event(&mut self) -> Event
pub fn wait_event(&mut self) -> Event
Wait indefinitely for an input event to be available from the window.
pub fn wait_event_timeout(&mut self, _timeout: Duration) -> Option<Event>
pub fn wait_event_timeout(&mut self, _timeout: Duration) -> Option<Event>
Wait for an input event to be available from the window or for the specified timeout to be reached. Read more
pub fn poll_event(&mut self) -> Option<Event>
pub fn poll_event(&mut self) -> Option<Event>
Polls an input event from the window. Read more
Auto Trait Implementations
impl RefUnwindSafe for NoWindow
impl Send for NoWindow
impl Sync for NoWindow
impl Unpin for NoWindow
impl UnwindSafe for NoWindow
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more