MCPcopy Index your code
hub / github.com/Yatekii/imgui-wgpu-rs

github.com/Yatekii/imgui-wgpu-rs @v0.28.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.28.0 ↗ · + Follow
86 symbols 115 edges 5 files 22 documented · 26% updated 2d agov0.28.0 · 2026-03-19★ 2914 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

imgui-wgpu

GitHub Workflow Status Documentation Crates.io License

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

screenshot

Getting Started

Add imgui-wgpu to your Cargo.toml:

[dependencies]
imgui-wgpu = "0.28"
imgui = "0.12"
wgpu = "29"

Usage

Create a Renderer during setup, then call render() each frame inside a wgpu render pass:

// Setup
let mut imgui = imgui::Context::create();
let renderer_config = imgui_wgpu::RendererConfig {
    texture_format: surface_format, // must match your surface
    ..imgui_wgpu::RendererConfig::new()
};
let mut renderer = imgui_wgpu::Renderer::new(&mut imgui, &device, &queue, renderer_config);

// Per frame
let draw_data = imgui_context.render();
let mut rpass = encoder.begin_render_pass(/* ... */);
renderer.render(draw_data, &queue, &device, &mut rpass).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 = imgui_wgpu::Texture::new(&device, &renderer, TextureConfig {
    size: wgpu::Extent3d { width: 64, height: 64, depth_or_array_layers: 1 },
    ..Default::default()
});
texture.write(&queue, &pixel_data, 64, 64);
let tex_id = renderer.textures.insert(texture);
// Use tex_id with imgui::Image

Examples

cargo run --release --example hello-world
cargo run --release --example custom-texture
cargo run --release --example cube
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.

Core symbols most depended-on inside this repo

vertex
called by 24
examples/cube.rs
render
called by 10
examples/cube.rs
size
called by 6
src/lib.rs
reload_font_texture
called by 5
src/lib.rs
write
called by 2
src/lib.rs
setup_camera
called by 2
examples/cube.rs
view
called by 1
src/lib.rs
prepare
called by 1
src/lib.rs

Shape

Method 56
Class 21
Function 7
Enum 2

Languages

Rust100%

Modules by API surface

src/lib.rs28 symbols
examples/cube.rs22 symbols
examples/hello-world.rs12 symbols
examples/empty.rs12 symbols
examples/custom-texture.rs12 symbols

For agents

$ claude mcp add imgui-wgpu-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page