imgui-winit

Crates.ioimgui-winit
lib.rsimgui-winit
version0.1.2
sourcesrc
created_at2018-11-16 23:57:06.594415
updated_at2018-12-04 13:39:44.239274
descriptionA simple translation layer between winit and imgui
homepagehttps://git.chronicembetterment.org/benjamin/imgui-winit
repositoryhttps://git.chronicembetterment.org/benjamin/imgui-winit
max_upload_size
id97155
size7,849
Benjamin Lee (Benjamin-L)

documentation

README

imgui-winit

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.

Example usage

// 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
}
Commit count: 0

cargo fmt