pub struct Window<UserEventType = ()> where
UserEventType: 'static, { /* private fields */ }
Expand description
Struct representing a window.
Implementations
pub fn new_centered<Str, Size>(
title: Str,
size: Size
) -> Result<Window<()>, BacktraceError<WindowCreationError>> where
Str: AsRef<str>,
Size: Into<Vector2<u32>>,
pub fn new_centered<Str, Size>(
title: Str,
size: Size
) -> Result<Window<()>, BacktraceError<WindowCreationError>> where
Str: AsRef<str>,
Size: Into<Vector2<u32>>,
Create a new window, centered in the middle of the primary monitor.
pub fn new_fullscreen_borderless<Str>(
title: Str
) -> Result<Window<()>, BacktraceError<WindowCreationError>> where
Str: AsRef<str>,
pub fn new_fullscreen_borderless<Str>(
title: Str
) -> Result<Window<()>, BacktraceError<WindowCreationError>> where
Str: AsRef<str>,
Create a new window, in fullscreen borderless mode on the primary monitor.
pub fn new_with_options(
title: &str,
options: WindowCreationOptions
) -> Result<Window<()>, BacktraceError<WindowCreationError>>
pub fn new_with_options(
title: &str,
options: WindowCreationOptions
) -> Result<Window<()>, BacktraceError<WindowCreationError>>
Create a new window with the specified options.
pub fn new_with_user_events(
title: &str,
options: WindowCreationOptions
) -> Result<Self, BacktraceError<WindowCreationError>>
pub fn new_with_user_events(
title: &str,
options: WindowCreationOptions
) -> Result<Self, BacktraceError<WindowCreationError>>
Create a new window with the specified options, with support for user events. See window::UserEventSender.
Creates a window::UserEventSender, which can be used to post custom events to this event loop from another thread.
If calling this, specify the type of the event data using
Window::<YourTypeHere>::new_with_user_events()
.
See UserEventSender::send_event, WindowHandler::on_user_event.
Run the window event loop, with the specified callback handler.
Once the event loop finishes running, the entire app will terminate, even if other threads are still running. See window::WindowHelper::terminate_loop().