[][src]Crate imgui_glfw_rs

ImGui input handling for Glfw.

Example use

You can run this example with cargo run --example helloworld

I recommend using the re-exported glfw to avoid version conflicts. You can do so with use imgui_glfw_rs::glfw as glfw;

// Use the reexported glfw crate to avoid version conflicts.
use imgui_glfw_rs::glfw;
// Use the reexported imgui crate to avoid version conflicts.
use imgui_glfw_rs::imgui;
use imgui_glfw_rs::ImguiGLFW;

fn main() {
    // Initialize imgui and glfw.
    // { ... }

    let mut imgui_glfw = ImguiGLFW::new(&mut imgui);

    while !window.should_close() {
        unsafe {
            gl::Clear(gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT);
        }

        let ui = imgui_glfw.frame(&mut window, &mut imgui);
        // Draw your ui.
        // { ... }

        // Handle imgui events
        glfw.poll_events();
        for (_, event) in glfw::flush_messages(&events) {
            imgui_glfw.handle_event(&mut imgui, &event);
        }
    }
}

Re-exports

pub use glfw;
pub use imgui;

Structs

ImguiGLFW