[][src]Struct riddle_platform_winit::WindowBuilder

pub struct WindowBuilder { /* fields omitted */ }

Builder for Window instances.

Default values:

Example

use riddle::{*, platform::*};

fn main() -> Result<(), RiddleError> {
    let rdl =  RiddleLib::new()?;

    let window: WindowHandle = WindowBuilder::new()
        .title("A Sample Title")
        .dimensions(320, 240)
        .build(rdl.context())?;

    // The window has been created, and is visible now.
    // [.. the rest of the application ..]
}

Implementations

impl WindowBuilder[src]

pub fn new() -> Self[src]

pub fn dimensions(&mut self, width: u32, height: u32) -> &mut Self[src]

Set the dimensions of the window, in logical units.

The pixel dimensions of the window may be different if the display's scale factor does not equal 1.

pub fn resizeable(&mut self, resizeable: bool) -> &mut Self[src]

Set whether the window is resizeable.

pub fn title<S: Into<String>>(&mut self, title: S) -> &mut Self[src]

Set the window's title.

pub fn cursor_visible(&mut self, cursor_visible: bool) -> &mut Self[src]

Set whether the system cursor will be displayed for the created window.

pub fn build<'a, C>(&self, ctx: C) -> Result<WindowHandle, PlatformError> where
    C: Borrow<PlatformContext<'a>>, 
[src]

Build the new window, returning a handle to the new window.

The window will be visible as long as the handle, or a clone of it, is alive.

Trait Implementations

impl Default for WindowBuilder[src]

Auto Trait Implementations

impl RefUnwindSafe for WindowBuilder

impl Send for WindowBuilder

impl Sync for WindowBuilder

impl Unpin for WindowBuilder

impl UnwindSafe for WindowBuilder

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.