Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.51 KB

README.md

File metadata and controls

56 lines (40 loc) · 1.51 KB

imnodes-rs

Tests

These are bindings for imnodes using cimnodes for imgui-rs.

They are inspsired by implot-rs.

example image

docs

cargo doc --no-deps --open

TODO/ Ideas

  • add example with salsa or some other incremental computation lib
  • IO
    • all Mouse/ Modifier helpers

nice to have:

  • use Serde to make it possible to declare graphs and render them
    • load and save as well using imnode_* functions
  • add comments to everything
    • figure out good descriptions of coordinate systems
  • review types in unsafe code
    • especially -> &mut sys::Style

Example (see imnodes-wgpu-examples/src/hello_world.rs)

fn show(ui: &imgui::Ui, context: &mut imnodes::EditorContext) {
    let mut id_generator = context.new_identifier_generator();

    imnodes::editor(context, |mut editor| {
        editor.add_node(id_generator.next_node(), |mut node| {
            node.add_titlebar(|| ui.text("simple node :)"));

            node.add_input(
                id_generator.next_input_pin(),
                imnodes::PinShape::Circle,
                || ui.text("input"),
            );

            node.add_output(
                id_generator.next_output_pin(),
                imnodes::PinShape::QuadFilled,
                || ui.text("output"),
            );
        });
    });
}