Struct speedy2d::Window[][src]

pub struct Window<UserEventType = ()> where
    UserEventType: 'static, 
{ /* fields omitted */ }

Struct representing a window.

Implementations

impl Window<()>[src]

pub fn new_centered<Str, Size>(
    title: Str,
    size: Size
) -> Result<Window<()>, BacktraceError<WindowCreationError>> where
    Str: AsRef<str>,
    Size: Into<Vector2<u32>>, 
[src]

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>, 
[src]

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>>
[src]

Create a new window with the specified options.

impl<UserEventType: 'static> Window<UserEventType>[src]

pub fn new_with_user_events(
    title: &str,
    options: WindowCreationOptions
) -> Result<Self, BacktraceError<WindowCreationError>>
[src]

Create a new window with the specified options, with support for user events. See window::UserEventSender.

pub fn create_user_event_sender(&self) -> UserEventSender<UserEventType>[src]

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.

pub fn run_loop<H>(self, handler: H) -> ! where
    H: WindowHandler<UserEventType> + 'static, 
[src]

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 WindowHelper::terminate_loop().

Auto Trait Implementations

impl<UserEventType = ()> !RefUnwindSafe for Window<UserEventType>

impl<UserEventType = ()> !Send for Window<UserEventType>

impl<UserEventType = ()> !Sync for Window<UserEventType>

impl<UserEventType> Unpin for Window<UserEventType> where
    UserEventType: Unpin

impl<UserEventType = ()> !UnwindSafe for Window<UserEventType>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.