23 releases (14 breaking)
Uses old Rust 2015
| 0.15.3 | Dec 5, 2023 |
|---|---|
| 0.15.2 | Aug 26, 2023 |
| 0.15.1 | Jan 14, 2023 |
| 0.15.0 | Feb 28, 2022 |
| 0.2.2 | Jun 6, 2018 |
#759 in GUI
31 downloads per month
Used in 2 crates
12KB
203 lines
imgui-sdl2
SDL2 Input handling for imgui-rs
Integration guide
- Construct it.
let mut imgui_sdl2 = imgui_sdl2::ImguiSdl2::new(&mut imgui, &window); - At the top of your event handling loop, pass in the input events, and ignore the ones that imgui has captured.
imgui_sdl2.handle_event(&mut imgui, &event); if imgui_sdl2.ignore_event(&event) { continue; } - Call
prepare_framebefore callingimgui.frame().imgui_sdl2.prepare_frame(imgui.io_mut(), &window, &event_pump.mouse_state()); - Call
prepare_renderimmediately before your UI rendering code.imgui_sdl2.prepare_render(&ui, &window);
Take a look at the example app to see it all in context.
Dependencies
~29MB
~584K SLoC