5 releases (3 breaking)
Uses new Rust 2024
| 0.6.0 | Nov 28, 2025 |
|---|---|
| 0.5.0 | Oct 24, 2025 |
| 0.4.1 | Oct 7, 2025 |
| 0.4.0 | Oct 7, 2025 |
| 0.3.0 | Oct 6, 2025 |
#2120 in GUI
1MB
21K
SLoC
dear-app
Convenient Dear ImGui application runner for dear-imgui-rs, bundling Winit + WGPU setup into a tiny API. It hides boilerplate, exposes ergonomic callbacks, and can initialize popular add-ons (ImPlot, ImNodes, ImPlot3D) behind feature flags.
Features
- Winit + WGPU app bootstrap with sensible defaults
- Per-frame UI closure (
run_simple) and a configurable builder (AppBuilder) - Optional add-ons via features:
implot,imnodes,implot3d - Docking helpers, theme presets, INI path selection
- Lifecycle callbacks: setup/style/fonts/post-init/event/exit
Quick Start
[dependencies]
dear-app = "0.5"
# Optional add-ons (enable any subset)
dear-app = { version = "0.5", features = ["implot", "imnodes", "implot3d"] }
Minimal usage:
use dear_app::run_simple;
use dear_imgui_rs::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
run_simple(|ui| {
ui.window("Hello")
.size([360.0, 160.0], Condition::FirstUseEver)
.build(|| ui.text("Hello from dear-app!"));
})?;
Ok(())
}
Builder with add-ons and docking/theme presets:
use dear_app::{AppBuilder, AddOnsConfig, RunnerConfig, Theme};
use dear_imgui_rs as imgui;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let cfg = RunnerConfig { theme: Some(Theme::Dark), ..Default::default() };
let addons = AddOnsConfig::auto(); // enable compiled add-ons
AppBuilder::new()
.with_config(cfg)
.with_addons(addons)
.on_frame(|ui: &imgui::Ui, addons| {
ui.window("App").build(|| {
ui.text("Docking and WGPU are ready!");
#[cfg(feature = "implot")]
if let Some(pc) = addons.implot { let plot = ui.implot(pc); let _ = plot; }
#[cfg(feature = "imnodes")]
if let Some(nc) = addons.imnodes { let _ = nc; /* ui.imnodes(nc) ... */ }
#[cfg(feature = "implot3d")]
if let Some(pc3) = addons.implot3d { let _ = pc3; }
});
})
.run()?;
Ok(())
}
Notes
- Backends: Uses
dear-imgui-winitanddear-imgui-wgpuinternally. - Fonts/FreeType: Configure in the
on_fontscallback; FreeType can be enabled viadear-imgui-rs/freetype.
Dependencies
~9–32MB
~487K SLoC