Skip to content
Rust library to build imgui GUIs using a derive macro
Rust Shell
Branch: master
Clone or download
Latest commit a40fc45 Aug 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets readme example Jun 2, 2019
ci update ci Jun 3, 2019
examples imgui 0.1 Jul 20, 2019
imgui_derive new syn version Aug 15, 2019
src readme & doc tweak Jul 20, 2019
tests Ui -> Gui May 28, 2019
.gitignore put input text & numeric in the same tag/module Mar 1, 2019
.rustfmt.toml rustfmt May 25, 2019
.travis.yml Fix CI attempt #1 Jun 2, 2019
Cargo.toml Update gl requirement from 0.12.0 to 0.13.0 Jul 20, 2019
LICENSE.md README Jan 28, 2019
README.md readme & doc tweak Jul 20, 2019

README.md

imgui-ext

Build Status Cargo package docs.rs docs Master docs

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 for structs with named fields.

License

MIT

You can’t perform that action at this time.