imgui: Add mouse_delta

This commit is contained in:
Malik Olivier Boussejra 2018-03-26 00:31:23 +09:00
parent e90a92c582
commit abbbfdfa79

View File

@ -190,6 +190,11 @@ impl ImGui {
io.mouse_pos.x = x;
io.mouse_pos.y = y;
}
/// Get mouse's position's delta between the current and the last frame.
pub fn mouse_delta(&self) -> (f32, f32) {
let io = self.io();
(io.mouse_delta.x, io.mouse_delta.y)
}
pub fn set_mouse_down(&mut self, states: &[bool; 5]) {
let io = self.io_mut();
io.mouse_down = *states;