Struct window::WindowSettings [−][src]
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]
impl WindowSettingspub fn new<T: Into<String>, S: Into<Size>>(title: T, size: S) -> WindowSettings[src]
pub fn new<T: Into<String>, S: Into<Size>>(title: T, size: S) -> WindowSettingsCreates window settings with defaults.
- samples: 0
- fullscreen: false
- exit_on_esc: false
- vsync: false
- srgb: true
- resizable: true
- decorated: true
- controllers: true
pub fn build<W: BuildFromWindowSettings>(&self) -> Result<W, String>[src]
pub fn build<W: BuildFromWindowSettings>(&self) -> Result<W, String>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.
pub fn get_title(&self) -> String[src]
pub fn get_title(&self) -> StringGets the title of built windows.
pub fn set_title(&mut self, value: String)[src]
pub fn set_title(&mut self, value: String)Sets the title of built windows.
pub fn title(self, value: String) -> Self[src]
pub fn title(self, value: String) -> SelfSets the title of built windows.
This method moves the current window data,
unlike set_title(),
so that it can be used in method chaining.
pub fn get_size(&self) -> Size[src]
pub fn get_size(&self) -> SizeGets the size of built windows.
pub fn set_size(&mut self, value: Size)[src]
pub fn set_size(&mut self, value: Size)Sets the size of built windows.
pub fn size(self, value: Size) -> Self[src]
pub fn size(self, value: Size) -> SelfSets the size of built windows.
This method moves the current window data,
unlike set_size(),
so that it can be used in method chaining.
pub fn get_fullscreen(&self) -> bool[src]
pub fn get_fullscreen(&self) -> boolGets whether built windows will be fullscreen.
pub fn set_fullscreen(&mut self, value: bool)[src]
pub fn set_fullscreen(&mut self, value: bool)Sets whether built windows will be fullscreen.
pub fn fullscreen(self, value: bool) -> Self[src]
pub fn fullscreen(self, value: bool) -> SelfSets 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.
pub fn get_exit_on_esc(&self) -> bool[src]
pub fn get_exit_on_esc(&self) -> boolGets whether built windows should exit when the Esc key is pressed.
pub fn set_exit_on_esc(&mut self, value: bool)[src]
pub fn set_exit_on_esc(&mut self, value: bool)Sets whether built windows should exit when the Esc key is pressed.
pub fn exit_on_esc(self, value: bool) -> Self[src]
pub fn exit_on_esc(self, value: bool) -> SelfSets 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.
pub fn get_samples(&self) -> u8[src]
pub fn get_samples(&self) -> u8Gets the number of samples to use for anti-aliasing.
See https://en.wikipedia.org/wiki/Multisample_anti-aliasing for more information.
pub fn set_samples(&mut self, value: u8)[src]
pub fn set_samples(&mut self, value: u8)Sets the number of samples to use for anti-aliasing.
See https://en.wikipedia.org/wiki/Multisample_anti-aliasing for more information.
pub fn samples(self, value: u8) -> Self[src]
pub fn samples(self, value: u8) -> SelfSets 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.
pub fn get_vsync(&self) -> bool[src]
pub fn get_vsync(&self) -> boolGets whether built windows should use vsync.
See https://en.wikipedia.org/wiki/Screen_tearing for more information about vsync.
pub fn set_vsync(&mut self, value: bool)[src]
pub fn set_vsync(&mut self, value: bool)Sets whether built windows should use vsync.
See https://en.wikipedia.org/wiki/Screen_tearing for more information about vsync.
pub fn vsync(self, value: bool) -> Self[src]
pub fn vsync(self, value: bool) -> SelfSets 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.
pub fn get_maybe_opengl(&self) -> Option<OpenGL>[src]
pub fn get_maybe_opengl(&self) -> Option<OpenGL>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.
pub fn set_maybe_opengl(&mut self, value: Option<OpenGL>)[src]
pub fn set_maybe_opengl(&mut self, value: Option<OpenGL>)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.
pub fn maybe_opengl(self, value: Option<OpenGL>) -> Self[src]
pub fn maybe_opengl(self, value: Option<OpenGL>) -> SelfSets 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.
pub fn set_opengl(&mut self, value: OpenGL)[src]
pub fn set_opengl(&mut self, value: OpenGL)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.
pub fn opengl(self, value: OpenGL) -> Self[src]
pub fn opengl(self, value: OpenGL) -> SelfSets 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.
pub fn get_srgb(&self) -> bool[src]
pub fn get_srgb(&self) -> boolGets 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.
pub fn set_srgb(&mut self, value: bool)[src]
pub fn set_srgb(&mut self, value: bool)Sets whether built windows should use hardware accelerated color conversion.
See get_srgb() for more information about
the srgb setting.
pub fn srgb(self, value: bool) -> Self[src]
pub fn srgb(self, value: bool) -> SelfSets 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.
pub fn get_resizable(&self) -> bool[src]
pub fn get_resizable(&self) -> boolGets whether built windows should be resizable.
pub fn set_resizable(&mut self, value: bool)[src]
pub fn set_resizable(&mut self, value: bool)Sets whether built windows should be resizable.
pub fn resizable(self, value: bool) -> Self[src]
pub fn resizable(self, value: bool) -> SelfSets 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.
pub fn get_decorated(&self) -> bool[src]
pub fn get_decorated(&self) -> boolGets 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
pub fn set_decorated(&mut self, value: bool)[src]
pub fn set_decorated(&mut self, value: bool)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
pub fn decorated(self, value: bool) -> Self[src]
pub fn decorated(self, value: bool) -> SelfSets 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.
pub fn get_controllers(&self) -> bool[src]
pub fn get_controllers(&self) -> boolGets whether built windows should listen to controller input.
pub fn set_controllers(&mut self, value: bool)[src]
pub fn set_controllers(&mut self, value: bool)Sets whether built windows should listen to controller input.
pub fn controllers(self, value: bool) -> Self[src]
pub fn controllers(self, value: bool) -> SelfSets 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]
impl Clone for WindowSettingsfn clone(&self) -> WindowSettings[src]
fn clone(&self) -> WindowSettingsReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
Auto Trait Implementations
impl Send for WindowSettings
impl Send for WindowSettingsimpl Sync for WindowSettings
impl Sync for WindowSettings