#imgui #direct-x #renderer #imgui-rs #com-ptr #devices

imgui-dx9-renderer

DirectX 9 renderer for the imgui crate

12 releases (breaking)

0.10.0 Mar 5, 2023
0.8.0 Nov 2, 2021
0.7.0 Mar 19, 2021
0.6.0 Dec 19, 2020
0.3.0 Jul 12, 2019

#344 in Rendering

Download history 14/week @ 2024-09-23

51 downloads per month

MIT license

22KB
375 lines

imgui-dx9-renderer

Documentation Version

DirectX 9 renderer for imgui-rs.

Usage

This crate makes use of the ComPtr wrapper of the wio crate. You have to either wrap your device pointer in one to pass it to the renderer new constructor or pass it to new_raw which will increment the ref count for you.

let device: *mut IDirect3DDevice9 = /* */;

let mut renderer = unsafe {
    imgui_dx9_renderer::Renderer::new(&mut imgui, wio::com::ComPtr::from_raw(device)).unwrap()
};
// or 
let mut renderer = unsafe {
    imgui_dx9_renderer::Renderer::new_raw(&mut imgui, device).unwrap()
};

Then in your rendering loop it's as easy as calling renderer.render(ui.render()).

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

~140MB
~2.5M SLoC