dear-imgui-wgpu
WGPU renderer for Dear ImGui.
Quick Start
use Context;
use ;
// device, queue, surface_format prepared ahead
let mut renderer = new?;
// Optional: unify gamma policy across backends
renderer.set_gamma_mode; // Auto | Linear | Gamma22
// per-frame
renderer.render_draw_data?;
For multi-context applications, use render_context() or render_context_with_fb_size() so
draw callbacks read Renderer_RenderState from the matching ImGui context's PlatformIO.
Selecting wgpu version
By default this crate uses wgpu v29.
If your ecosystem is pinned to wgpu v28 or wgpu v27, select it explicitly:
[]
= { = "0.13.0", = false, = ["wgpu-28"] }
[]
= { = "0.13.0", = false, = ["wgpu-27"] }
What You Get
- ImGui v1.92 texture system integration (create/update/destroy)
- Multi-frame buffering and device-object management
- Format-aware or user-controlled gamma (see below)
sRGB / Gamma
- Default
GammaMode::Auto: picksgamma=2.2for sRGB targets and1.0for linear targets. - You can force
Linear(1.0) orGamma22(2.2). - Pair this with your swapchain format to avoid double correction.
Compatibility
| Item | Version |
|---|---|
| Crate | 0.13.0 |
| dear-imgui-rs | 0.13.0 |
| wgpu | 29 (default), 28 (wgpu-28), 27 (wgpu-27) |
See also: docs/COMPATIBILITY.md for the full workspace matrix.
Notes
- Targets native and Web (with
webgl/webgpufeatures mapped to wgpu features). - External dependency updates (wgpu) may require coordinated version bumps.
Features
- Default: no extra features required for native builds
- WGPU version selection (mutually exclusive)
wgpu-29(default)wgpu-28wgpu-27
- WASM targets
webgl/webgpuselect the WASM route for the defaultwgpu-29build- With
wgpu-28, usewebgl-wgpu28/webgpu-wgpu28instead - With
wgpu-27, usewebgl-wgpu27/webgpu-wgpu27instead
Pick exactly one of webgl or webgpu for browser targets; for native leave both off.