[][src]Struct beryllium::Window

#[repr(transparent)]
pub struct Window<'sdl> { /* fields omitted */ }

Handle to a window on the screen.

Methods

impl<'sdl> Window<'sdl>[src]

pub fn modal_message_box(
    &self,
    box_type: MessageBox,
    title: &str,
    message: &str
) -> Result<(), String>
[src]

Like the lone_message_box function, but modal to this Window.

Because you need a valid Window to call this method, we don't need to mark it as unsafe.

pub fn flags(&self) -> WindowFlags[src]

Use this function to get the window flags.

pub fn resizable(&self) -> bool[src]

Returns the user-resizable state of a window.

pub fn set_resizable(&self, resizable: bool)[src]

Use this function to set the user-resizable state of a window.

pub fn title(&self) -> String[src]

Returns the title of the window in UTF-8 format or "" if there is no title.

pub fn set_title(&self, title: &str)[src]

Sets the title of the window.

pub fn show(&self)[src]

Use this function to show a window.

pub fn hide(&self)[src]

Use this function to hide a window.

pub fn size(&self) -> (i32, i32)[src]

Gets the logical size of the window (in screen coordinates).

For physical pixel counts use the method appropriate to your backend: GLWindow::drawable_size or RendererWindow::output_size.

pub fn set_size(&self, width: i32, height: i32)[src]

Sets the logical size of the window.

Note that fullscreen windows automatically match the size of the display mode, so use set_display_mode instead.

pub fn window_display_mode(&self) -> Result<DisplayMode, String>[src]

Obtains info about the fullscreen settings of the window.

Use this function to get info about the display mode that the Window uses when it's fullscreen.

pub fn desktop_display_mode(&self) -> Result<DisplayMode, String>[src]

Obtains info about the monitor settings that the center of the window is being displayed on.

Use this function to get information about the Desktop display mode (even if a Window is currently fullscreen).

pub fn set_display_mode(
    &self,
    opt_mode: Option<DisplayMode>
) -> Result<(), String>
[src]

Assigns the fullscreen display mode for the window.

  • If Some(mode), attempts to set the mode given.
  • If None, it will use the window's dimensions, and the desktop's current format and refresh rate.

pub fn set_fullscreen_style(&self, style: FullscreenStyle) -> Result<(), String>[src]

Sets the window's fullscreen style.

  • Fullscreen: Performs an actual video mode change.
  • Fullscreen Desktop: "fake" fullscreen with full resolution but no video mode change.
  • Windowed: Don't use fullscreen.

pub unsafe fn try_into_renderer(
    self,
    driver_index: Option<usize>,
    flags: RendererFlags
) -> Result<RendererWindow<'sdl>, (Self, String)>
[src]

Attempts to promote this Window into a RendererWindow.

You can request details via the flags and also Some(index) for a particular driver index. If you request None then the first driver index that supports the flags will be suggested.

Failure

Well the wiki isn't super precise about things that can make it fail, but at a minimum if you request an impossible situation it'll probably fail.

In case of failure, you get both this window back as a normal window and also the error message.

pub fn try_into_gl(self) -> Result<GLWindow<'sdl>, (Self, String)>[src]

Attempts to promote this Window into a GLWindow.

Failure

OpenGL is a nightmare and context creation can fail because of cosmic rays or really even if there aren't cosmic rays.

Trait Implementations

impl<'sdl> Drop for Window<'sdl>[src]

impl<'sdl> Debug for Window<'sdl>[src]

Auto Trait Implementations

impl<'sdl> Unpin for Window<'sdl>

impl<'sdl> !Sync for Window<'sdl>

impl<'sdl> !Send for Window<'sdl>

impl<'sdl> UnwindSafe for Window<'sdl>

impl<'sdl> RefUnwindSafe for Window<'sdl>

Blanket Implementations

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.

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

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

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