All Projects → imgui-rs → Imgui Rs

imgui-rs / Imgui Rs

Licence: other
Rust bindings for Dear ImGui

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Imgui Rs

Iconfontcppheaders
C, C++ headers and C# classes for icon fonts: Font Awesome, Fork Awesome, Material Design, Kenney game icons and Fontaudio
Stars: ✭ 509 (-59.54%)
Mutual labels:  gui, imgui
Imgui Sfml
Dear ImGui binding for use with SFML
Stars: ✭ 596 (-52.62%)
Mutual labels:  gui, imgui
Dearpygui
Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
Stars: ✭ 6,631 (+427.11%)
Mutual labels:  gui, imgui
Imgui
Bloat-free Immediate Mode Graphical User interface for JVM with minimal dependencies (rewrite of dear imgui)
Stars: ✭ 394 (-68.68%)
Mutual labels:  gui, imgui
Imgui
Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
Stars: ✭ 33,574 (+2568.84%)
Mutual labels:  gui, imgui
Nuklear
A single-header ANSI C immediate mode cross-platform GUI library
Stars: ✭ 5,055 (+301.83%)
Mutual labels:  gui, imgui
Imgui markdown
Markdown for Dear ImGui
Stars: ✭ 594 (-52.78%)
Mutual labels:  gui, imgui
Webgui
An example demo of IMGUI (Immediate Mode GUI) on the web. Using only WebGL, GLFW and ImGui. Suitable for being compiled to web assembly (WASM).
Stars: ✭ 180 (-85.69%)
Mutual labels:  gui, imgui
Giu
Cross platform rapid GUI framework for golang based on Dear ImGui.
Stars: ✭ 862 (-31.48%)
Mutual labels:  gui, imgui
Cimgui
c-api for imgui (https://github.com/ocornut/imgui) Look at: https://github.com/cimgui for other widgets
Stars: ✭ 707 (-43.8%)
Mutual labels:  gui, imgui
Imgui Plot
An improved plot widget for Dear ImGui, aimed at displaying audio data
Stars: ✭ 332 (-73.61%)
Mutual labels:  gui, imgui
Asap app imgui
Starter project for portable app with optional GUI (GLFW/ImGui) and a rich builtin debug UI. Includes docked windows, log viewer, settings editor, configuration load/save, etc...
Stars: ✭ 70 (-94.44%)
Mutual labels:  gui, imgui
Love Nuklear
Lightweight immediate mode GUI for LÖVE games
Stars: ✭ 281 (-77.66%)
Mutual labels:  gui, imgui
Imgui Go
Go wrapper library for "Dear ImGui" (https://github.com/ocornut/imgui)
Stars: ✭ 499 (-60.33%)
Mutual labels:  gui, imgui
Nuklear
A single-header ANSI C gui library
Stars: ✭ 13,365 (+962.4%)
Mutual labels:  gui, imgui
Layout
Single-file library for calculating 2D UI layouts using stacking boxes. Compiles as C99 or C++.
Stars: ✭ 551 (-56.2%)
Mutual labels:  gui, imgui
Bimpy
imgui for python
Stars: ✭ 144 (-88.55%)
Mutual labels:  gui, imgui
Rapidgui
Unity OnGUI(IMGUI) extensions for Rapid prototyping/development
Stars: ✭ 144 (-88.55%)
Mutual labels:  gui, imgui
Cvui
A (very) simple UI lib built on top of OpenCV drawing primitives
Stars: ✭ 619 (-50.79%)
Mutual labels:  gui, imgui
Wtk
📺 A cross-platform immediate mode user-interface library. Public domain.
Stars: ✭ 30 (-97.62%)
Mutual labels:  gui, imgui

imgui-rs: Rust bindings for Dear ImGui

Build Status Latest release on crates.io Documentation on docs.rs Wrapped Dear ImGui Version

(Recently under new maintenance, things subject to change)

Hello world

Window::new(im_str!("Hello world"))
    .size([300.0, 100.0], Condition::FirstUseEver)
    .build(&ui, || {
        ui.text(im_str!("Hello world!"));
        ui.text(im_str!("こんにちは世界!"));
        ui.text(im_str!("This...is...imgui-rs!"));
        ui.separator();
        let mouse_pos = ui.io().mouse_pos;
        ui.text(format!(
            "Mouse Position: ({:.1},{:.1})",
            mouse_pos[0], mouse_pos[1]
        ));
    });

Main library crates

  • imgui: High-level safe API
  • imgui-glium-renderer: Renderer implementation that uses the glium crate
  • imgui-gfx-renderer: Renderer implementation that uses the gfx crate (not the new gfx-hal crate)
  • imgui-winit-support: Backend platform implementation that uses the winit crate (latest by default, but earlier versions are supported via feature flags)
  • imgui-sys: Low-level unsafe API (automatically generated)

Features

  • Bindings for Dear ImGui that can be used with safe Rust. Note: API coverage is not 100%, but will keep improving over time.
  • Builder structs for use cases where the original C++ library uses optional function parameters
  • &ImStr / ImString types and im_str! macro for defining and passing null-terminated UTF-8 to Dear ImGui, which doesn't accept Rust &str / String values. See issue #7 for more information and justification for this design.
  • Easy integration with Glium / pre-ll gfx (renderer)
  • Easy integration with winit (backend platform)

Choosing a backend platform and a renderer

Almost every application that uses imgui-rs needs two additional components in addition to the main imgui crate: a backend platform, and a renderer.

The backend platform is responsible for integrating imgui-rs with the operating system and its window management. Its responsibilities include the following:

  • Handling input events (e.g. keyboard, mouse) and updating imgui-rs state accordingly
  • Passing information about the OS window (e.g. size, DPI factor) to imgui-rs
  • Updating the OS-side mouse cursor when imgui-rs requests it

The renderer is responsible for taking generic, renderer-agnostic draw lists generated by imgui-rs, and rendering them using some graphics API. Its responsibilities include the following:

  • Rendering using vertex/index buffers and command lists
  • Handling of DPI factors and scissor rects
  • Texture management

The most tested platform/renderer combination is imgui-glium-renderer + glium + imgui-winit-support + winit, but this is not the only possible combination. There's also imgui-gfx-renderer, and you can find additional 3rd party crates that provide a wider support for more libraries (e.g. raw OpenGL, SDL2). You can also write your own support code if you have a more advanced use case, because imgui-rs is not tied to any specific graphics / OS API.

Compiling and running the demos

git clone https://github.com/imgui-rs/imgui-rs
cd imgui-rs
git submodule update --init --recursive

Main examples are located in the imgui-examples directory.

# At the reposity root
cd imgui-examples
cargo test

cargo run --example hello_world
cargo run --example test_window
cargo run --example test_window_impl

Examples for the gfx backend are under the imgui-gfx-examples directory.

cd imgui-gfx-examples
cargo test

cargo run --example hello_world
cargo run --example test_window

Note to Windows users: You will need to use the MSVC ABI version of the Rust compiler along with its associated dependencies to build this libary and run the examples.

How to contribute

  1. Change or add something

  2. Make sure you're using the latest stable Rust

  3. Run rustfmt to guarantee code style conformance

    rustup component add rustfmt
    cargo fmt
    
  4. Open a pull request in Github

License

Licensed under either of

at your option.

Uses Dear ImGui and cimgui.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].