imgui-wgpu
A wgpu render backend for dear imgui (imgui-rs).

Getting Started
Add imgui-wgpu to your Cargo.toml:
[]
= "0.28"
= "0.12"
= "29"
Usage
Create a Renderer during setup, then call render() each frame inside a wgpu render pass:
// Setup
let mut imgui = create;
let renderer_config = RendererConfig ;
let mut renderer = new;
// Per frame
let draw_data = imgui_context.render;
let mut rpass = encoder.begin_render_pass;
renderer.render.unwrap;
For more control over GPU buffer lifetime, use prepare() + split_render() instead of render().
Color Space
RendererConfig::new() (the default) outputs linear color for sRGB framebuffers (Bgra8UnormSrgb). Use RendererConfig::new_srgb() if rendering to a linear framebuffer (Bgra8Unorm).
Custom Textures
let texture = new;
texture.write;
let tex_id = renderer.textures.insert;
// Use tex_id with imgui::Image
Examples
| Example | Description |
|---|---|
hello-world |
Basic imgui window with winit integration |
custom-texture |
Loading and displaying a custom image |
cube |
3D rendering with an imgui overlay |
empty |
Minimal test for empty draw lists |
Version Compatibility
| imgui-wgpu | wgpu | imgui |
|---|---|---|
| master | 29 | 0.12 |
| 0.28.0 | 29 | 0.12 |
| 0.27.0 | 28 | 0.12 |
| 0.26.0 | 27 | 0.12 |
| 0.25.0 | 25 | 0.12 |
| 0.24.0 | 0.17 | 0.11 |
| 0.23.0 | 0.16 | 0.11 |
| 0.22.0 | 0.15 | 0.10 |
| 0.21.0 | 0.14 | 0.9 |
| 0.20.0 | 0.13 | 0.8 |
| 0.19.0 | 0.12 | 0.8 |
| 0.18.0 | 0.11 | 0.8 |
| 0.17.0 | 0.10 | 0.8 |
| 0.16.0 | 0.9 | 0.7 |
| 0.15.0 | 0.8 | 0.7 |
| 0.14.0 | 0.7 | 0.7 |
| 0.13.0 | 0.7 | 0.6 |
| 0.12.0 | 0.6 | 0.6 |
| 0.11.0 | 0.6 | 0.5 |
| 0.10.0 | 0.6 | 0.5 |
| 0.9.0 | 0.6 | 0.4 |
| 0.8.0 | 0.5 | 0.4 |
| 0.7.0 | 0.5 | 0.4 |
| 0.6.0 | 0.5 | 0.3 |
| 0.5.0 | 0.4 | 0.3 |
| 0.4.0 | 0.4 | 0.2 |
| 0.1.0 | 0.3 | 0.2 |
Minimum Supported Rust Version (MSRV)
The MSRV of this crate is 1.87. MSRV bumps are considered breaking changes.
Contributing
Contributions are welcome! Please open an issue or pull request on GitHub.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.