Trait kludgine_app::Window[][src]

pub trait Window: Send + Sync + 'static {
    fn initialize(
        &mut self,
        _scene: &Target,
        _redrawer: RedrawRequester,
        _window: WindowHandle
    ) -> Result<()>
    where
        Self: Sized
, { ... }
fn close_requested(
        &mut self,
        _window: WindowHandle
    ) -> Result<CloseResponse> { ... }
fn process_input(
        &mut self,
        _input: InputEvent,
        _status: &mut RedrawStatus,
        _scene: &Target,
        _window: WindowHandle
    ) -> Result<()>
    where
        Self: Sized
, { ... }
fn receive_character(
        &mut self,
        _character: char,
        _status: &mut RedrawStatus,
        _scene: &Target,
        _window: WindowHandle
    ) -> Result<()>
    where
        Self: Sized
, { ... }
fn target_fps(&self) -> Option<u16> { ... }
fn render(
        &mut self,
        scene: &Target,
        status: &mut RedrawStatus,
        _window: WindowHandle
    ) -> Result<()> { ... }
fn update(
        &mut self,
        scene: &Target,
        status: &mut RedrawStatus,
        _window: WindowHandle
    ) -> Result<()>
    where
        Self: Sized
, { ... }
fn additional_scale(&self) -> Scale<f32, Scaled, Points> { ... } }
Expand description

Trait to implement a Window

Provided methods

Called when the window is being initilaized.

The window was requested to be closed, most likely from the Close Button. Override this implementation if you want logic in place to prevent a window from closing.

The window has received an input event.

A text input was received.

Specify a target frames per second, which will force your window to redraw at this rate. If None is returned, the Window will only redraw when requested via methods on Context.

Renders the contents of the window. Called whenever the operating system needs the window’s contents to be redrawn or when RedrawStatus indicates a new frame should be rendered in Window::update().

Called on a regular basis as events come in. Use status to indicate when a redraw should happen.

Called prior to rendering to allow setting a scaling amount that operates on top of the automatic DPI scaling. This can be used to offer a zoom setting to end-users.

Implementors