Trait rin::app::ApplicationCallbacks[][src]

pub trait ApplicationCallbacks {
Show methods pub fn update(
        &mut self,
        _delta: f64,
        _gl: &Renderer<'_, Screen>,
        _window: &mut Window
    ) { ... }
pub fn draw(&mut self, _gl: &Renderer<'_, Screen>, _window: &Window) { ... }
pub fn handle_event(
        &mut self,
        _gl: &Renderer<'_, Screen>,
        _window: &Window,
        event: &Event
    ) { ... }
pub fn key_pressed(&mut self, _key: Key, _mods: KeyModifiers, _repeat: bool) { ... }
pub fn key_released(&mut self, _key: Key) { ... }
pub fn mouse_moved(&mut self, _pos: Point<f64, U2>) { ... }
pub fn mouse_pressed(
        &mut self,
        _pos: Point<f64, U2>,
        _button: MouseButton,
        _mods: KeyModifiers
    ) { ... }
pub fn mouse_released(
        &mut self,
        _pos: Point<f64, U2>,
        _button: MouseButton,
        _mods: KeyModifiers
    ) { ... }
pub fn window_moved(&mut self, _pos: Point<i32, U2>) { ... }
pub fn window_resized(
        &mut self,
        _size: Matrix<i32, U2, U1, <DefaultAllocator as Allocator<i32, U2, U1>>::Buffer>
    ) { ... }
pub fn scroll(
        &mut self,
        _scroll: Matrix<f64, U2, U1, <DefaultAllocator as Allocator<f64, U2, U1>>::Buffer>
    ) { ... }
pub fn window_closing(&mut self) { ... }
pub 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

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

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

pub fn draw(&mut self, _gl: &Renderer<'_, Screen>, _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

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

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

A key was pressed

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

A kre was released

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

The mouse was moved

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

A mouse button was pressed

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

A mouse button was released

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

The window was moved

pub fn window_resized(
    &mut self,
    _size: Matrix<i32, U2, U1, <DefaultAllocator as Allocator<i32, U2, U1>>::Buffer>
)
[src]

The window was resized

pub fn scroll(
    &mut self,
    _scroll: Matrix<f64, U2, U1, <DefaultAllocator as Allocator<f64, U2, U1>>::Buffer>
)
[src]

The mouse wheel was scrolled

pub fn window_closing(&mut self)[src]

The window will close next

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

A file was droppped on this window

Loading content...

Implementors

Loading content...