Trait rin_app::ApplicationCallbacks[][src]

pub trait ApplicationCallbacks {
Show methods fn update(&mut self, _delta: f64, _gl: &Renderer<'_>, _window: &mut Window) { ... }
fn draw(&mut self, _gl: &Renderer<'_>, _window: &Window) { ... }
fn handle_event(
        &mut self,
        _gl: &Renderer<'_>,
        _window: &Window,
        event: &Event
    ) { ... }
fn key_pressed(&mut self, _key: Key, _mods: KeyModifiers, _repeat: bool) { ... }
fn key_released(&mut self, _key: Key) { ... }
fn mouse_moved(&mut self, _pos: Pnt2<f64>) { ... }
fn mouse_pressed(
        &mut self,
        _pos: Pnt2<f64>,
        _button: MouseButton,
        _mods: KeyModifiers
    ) { ... }
fn mouse_released(
        &mut self,
        _pos: Pnt2<f64>,
        _button: MouseButton,
        _mods: KeyModifiers
    ) { ... }
fn window_moved(&mut self, _pos: Pnt2<i32>) { ... }
fn window_resized(&mut self, _size: Vec2<i32>) { ... }
fn scroll(&mut self, _scroll: Vec2<f64>) { ... }
fn window_closing(&mut self) { ... }
fn dropped(&mut self, _paths: &[PathBuf]) { ... }
}

Trait to be implemented by applications that want to run under through an Application object

All methods in this trait are optional but without implementing them an application will do nothing

Provided methods

fn update(&mut self, _delta: f64, _gl: &Renderer<'_>, _window: &mut Window)[src]

Usually update the world here. Change the position of the objects, update colors…

fn draw(&mut self, _gl: &Renderer<'_>, _window: &Window)[src]

Render the world. Usually nothing should be changed from here but the call is &mut to make things easier in some cases

fn handle_event(&mut self, _gl: &Renderer<'_>, _window: &Window, event: &Event)[src]

fn key_pressed(&mut self, _key: Key, _mods: KeyModifiers, _repeat: bool)[src]

A key was pressed

fn key_released(&mut self, _key: Key)[src]

A kre was released

fn mouse_moved(&mut self, _pos: Pnt2<f64>)[src]

The mouse was moved

fn mouse_pressed(
    &mut self,
    _pos: Pnt2<f64>,
    _button: MouseButton,
    _mods: KeyModifiers
)
[src]

A mouse button was pressed

fn mouse_released(
    &mut self,
    _pos: Pnt2<f64>,
    _button: MouseButton,
    _mods: KeyModifiers
)
[src]

A mouse button was released

fn window_moved(&mut self, _pos: Pnt2<i32>)[src]

The window was moved

fn window_resized(&mut self, _size: Vec2<i32>)[src]

The window was resized

fn scroll(&mut self, _scroll: Vec2<f64>)[src]

The mouse wheel was scrolled

fn window_closing(&mut self)[src]

The window will close next

fn dropped(&mut self, _paths: &[PathBuf])[src]

A file was droppped on this window

Loading content...

Implementors

Loading content...