Crates.io | imgui-winit |
lib.rs | imgui-winit |
version | 0.1.2 |
source | src |
created_at | 2018-11-16 23:57:06.594415 |
updated_at | 2018-12-04 13:39:44.239274 |
description | A simple translation layer between winit and imgui |
homepage | https://git.chronicembetterment.org/benjamin/imgui-winit |
repository | https://git.chronicembetterment.org/benjamin/imgui-winit |
max_upload_size | |
id | 97155 |
size | 7,849 |
This is a simple translation layer between winit and imgui. It exists because I found myself repeating a bunch of specific boilerplate every time I used imgui, in order to translate winit events into imgui. This crate contains functionality for forwarding winit events to imgui, as well as keeping track of frame deltas and window size to pass to imgui.
// Initialization
let mut imgui_winit = ImGuiWinit::new(&mut imgui);
loop {
// In the main loop
event_loop.poll_events(|event| {
imgui_winit.handle_event(&mut imgui, &event);
// Other event handling
});
let ui = imgui_winit.frame(&mut imgui, &window);
// Draw ui
}