#imgui #renderer #directx

imgui-dx11-renderer

DirectX 11 renderer for the imgui crate

2 releases

0.1.1 Jul 21, 2020
0.1.0 Jul 19, 2020

#222 in GUI

MIT license

36KB
766 lines

imgui-dx11-renderer

Documentation Version

DirectX 11 renderer for imgui-rs.

Usage

This crate makes use of the ComPtr wrapper of the wio crate. You have to wrap your device pointer in one to pass it to the renderer should you not use these internally already, tho care must be taken in regards of the reference count.

let device: ComPtr<ID3D11Device> = ...;
let imgui: imgui::Context = ...;
let mut renderer = imgui_dx11_renderer::Renderer::new(&mut imgui, device.clone()).expect("imgui dx11 renderer creation failed");

// rendering loop

let ui = imgui.frame();

// build your window via ui here
...

// then to render call
renderer.render(ui.render()).expect("imgui rendering failed");

Documentation

The crate is documented but imgui-rs doesn't currently build on docs.rs for the windows target. Due to this one has to either build it themselves or look into the source itself.

License

Licensed under the MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

Dependencies

~5MB
~97K SLoC