Trait rin::prelude::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]
&mut self,
_delta: f64,
_gl: &Renderer<'_, Screen>,
_window: &mut Window
)
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]
&mut self,
_gl: &Renderer<'_, Screen>,
_window: &Window,
event: &Event
)
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]
&mut self,
_pos: Point<f64, U2>,
_button: MouseButton,
_mods: KeyModifiers
)
A mouse button was pressed
pub fn mouse_released(
&mut self,
_pos: Point<f64, U2>,
_button: MouseButton,
_mods: KeyModifiers
)
[src]
&mut self,
_pos: Point<f64, U2>,
_button: MouseButton,
_mods: KeyModifiers
)
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]
&mut self,
_size: Matrix<i32, U2, U1, <DefaultAllocator as Allocator<i32, U2, U1>>::Buffer>
)
The window was resized
pub fn scroll(
&mut self,
_scroll: Matrix<f64, U2, U1, <DefaultAllocator as Allocator<f64, U2, U1>>::Buffer>
)
[src]
&mut self,
_scroll: Matrix<f64, U2, U1, <DefaultAllocator as Allocator<f64, U2, U1>>::Buffer>
)
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