16 releases
0.3.0 | Aug 25, 2019 |
---|---|
0.2.1 | Jun 3, 2019 |
0.1.8 | Apr 3, 2019 |
0.1.7 | Mar 1, 2019 |
0.1.6 | Feb 9, 2019 |
#762 in GUI
70KB
962 lines
imgui-ext
A derive-macro for imgui.
#[derive(imgui_ext::Gui)]
struct Example {
#[imgui(slider(min = 0.0, max = 4.0))]
x: f32,
#[imgui(input(step = 2))]
y: i32,
#[imgui(drag(label = "Drag 2D"))]
drag_2d: [f32; 2],
#[imgui(checkbox(label = "Turbo mode"))]
turbo: bool,
}
let mut example = Example { /* skipped */ };
ui.window(im_str!("Debug")).build(|| {
use imgui_ext::UiExt;
if ui.draw_gui(&mut example).turbo() {
println!(
"Turbo mode value changed: {}",
example.turbo,
);
}
});
Examples
# codegen example (see examples/codegen.rs to see the code generated by the macro)
cargo run --example codegen
# several UI examples
cargo run --example ui
# integration with nalgebra types
cargo run --example nalgebra
Limitations
#[derive(imgui_ext::Gui)]
is only supported forstruct
s with named fields.
License
Dependencies
~15MB
~294K SLoC