[][src]Struct piston_window::WindowSettings

pub struct WindowSettings { /* fields omitted */ }

Settings structure for window behavior.

This structure stores everything that needs to be customized when constructing most windows. This structure makes it easy to create multiple windows with the same settings, and it also makes piston's multiple backends easier to implement for piston devs.

Methods

impl WindowSettings
[src]

Creates window settings with defaults.

  • samples: 0
  • fullscreen: false
  • exit_on_esc: false
  • vsync: false
  • srgb: true
  • resizable: true
  • decorated: true
  • controllers: true

Builds window from the given settings.

The return value is ambiguous, to allow for operation on multiple backends. Clients should explicitly name the return type. See the Guide to using Piston Windows for more info and examples.

Errors

This function will return an error if your backend returns an error. See your backend's documentation on build_from_window_settings() for more details.

Gets the title of built windows.

Sets the title of built windows.

Sets the title of built windows.

This method moves the current window data, unlike set_title(), so that it can be used in method chaining.

Gets the size of built windows.

Sets the size of built windows.

Sets the size of built windows.

This method moves the current window data, unlike set_size(), so that it can be used in method chaining.

Gets whether built windows will be fullscreen.

Sets whether built windows will be fullscreen.

Sets whether built windows will be fullscreen.

This method moves the current window data, unlike set_fullscreen(), so that it can be used in method chaining.

Gets whether built windows should exit when the Esc key is pressed.

Sets whether built windows should exit when the Esc key is pressed.

Sets whether built windows should exit when the Esc key is pressed.

This method moves the current window data, unlike set_exit_on_esc(), so that it can be used in method chaining.

Gets the number of samples to use for anti-aliasing.

See https://en.wikipedia.org/wiki/Multisample_anti-aliasing for more information.

Sets the number of samples to use for anti-aliasing.

See https://en.wikipedia.org/wiki/Multisample_anti-aliasing for more information.

Sets the number of samples to use for anti-aliasing.

See https://en.wikipedia.org/wiki/Multisample_anti-aliasing for more information.

This method moves the current window data, unlike set_samples() so that it can be used in method chaining.

Gets whether built windows should use vsync.

See https://en.wikipedia.org/wiki/Screen_tearing for more information about vsync.

Sets whether built windows should use vsync.

See https://en.wikipedia.org/wiki/Screen_tearing for more information about vsync.

Sets whether built windows should use vsync.

See https://en.wikipedia.org/wiki/Screen_tearing for more information about vsync.

This method moves the current window data, unlike set_vsync(), so that it can be used in method chaining.

Gets the OpenGL version of built windows.

If None is returned, the default OpenGL version is being used. This is often a forward compatible version of OpenGL::V3_2 or higher that works with newer versions of graphics libraries.

For more information about the OpenGL setting, see the OpenGLWindow trait.

Sets OpenGL version of built windows.

If None is passed, the default OpenGL version is used. This is often a forward compatible version of OpenGL::V3_2 or higher that works with newer versions of graphics libraries.

For more information about the OpenGL setting, see the OpenGLWindow trait.

Sets OpenGL version of built windows.

If None is passed, the default OpenGL version is used. This is often a forward compatible version of OpenGL::V3_2 or higher that works with newer versions of graphics libraries.

For more information about the OpenGL setting, see the OpenGLWindow trait.

This method moves the current window data, unlike set_maybe_opengl(), so that it can be used in method chaining.

Sets OpenGL version of built windows.

For setting the OpenGL version back to default, see set_maybe_opengl().

For more information about the opengl setting, see the OpenGLWindow trait.

Sets the OpenGL version of built windows.

For setting the OpenGL version back to default, see maybe_opengl().

For more information about the opengl setting, see the OpenGLWindow trait.

This method moves the current window data, unlike set_opengl(), so that it can be used in method chaining.

Gets whether built windows should use hardware accelerated color conversion.

If true, the graphics hardware uses customized circuitry to convert colors from sRGB to linear color space in graphics shaders, and then converts pixel fragments back to sRGB depending on the color format of the frame buffer. This feature is supported by most graphics hardware and set to true by default.

See https://en.wikipedia.org/wiki/SRGB for more information.

Sets whether built windows should use hardware accelerated color conversion.

See get_srgb() for more information about the srgb setting.

Sets whether built windows should use hardware accelerated color conversion.

See get_srgb() for more information about the srgb setting.

This method moves the current window data, unlike set_srgb(), so that it can be used in method chaining.

Gets whether built windows should be resizable.

Sets whether built windows should be resizable.

Sets whether built windows should be resizable.

This method moves the current window data, unlike set_resizable(), so that it can be used in method chaining.

Gets whether built windows should be decorated.

Decoration on a window refers to the Operating System's header above the window, and the window border.

For more information, see https://en.wikipedia.org/wiki/Window_decoration

Sets whether built windows should be decorated.

Decoration on a window refers to the Operating System's header above the window, and the window border.

For more information, see https://en.wikipedia.org/wiki/Window_decoration

Sets whether built windows should be decorated.

Decoration on a window refers to the Operating System's header above the window, and the window border.

For more information, see https://en.wikipedia.org/wiki/Window_decoration

This method moves the current window data, unlike set_decorated(), so that it can be used in method chaining.

Gets whether built windows should listen to controller input.

Sets whether built windows should listen to controller input.

Sets whether build windows should listen to controller input.

This method moves the current window data, unlike set_controllers(), so that it can be used in method chaining.

Trait Implementations

impl Clone for WindowSettings
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for WindowSettings

impl Sync for WindowSettings

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> SetParameter for T
[src]

Sets value as a parameter of self.

impl<T> Erased for T
[src]

impl<T> Downcast for T where
    T: Any
[src]

Convert Box<Trait> (where Trait: Downcast) to Box<Any>. Box<Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any's vtable from &Trait's. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any's vtable from &mut Trait's. Read more