Examples
There are a number of examples for custom renderers in the UntitledImGuiFramework that you can use:
- Basic OpenGL - Built-in OpenGL renderer
- Basic Vulkan - Built-in Vulkan renderer
- Basic WebGPU - Built-in WebGPU renderer
- Basic Metal, DirectX12 and bgfx - UImGuiRendererExamples
Warning
The WebGPU renderer has been temporarily removed since the 3rd of November 2025(Release 2.1.0.0). We're planning on reintroducing it in 2027. The link points to the last working version.
This version of the code is no longer supported by Emscripten versions newer than 4.0.17. This means that while this renderer could theoretically work if using the WGPU library, to use it with Emscripten, you'll need to rewrite the renderer using the Emscripten Dawn port. We have not been able to produce a working version as of yet, due to technical limitations.
For the renderer to work, it needs to fetch a device and adapter
which is an asynchronous operation. For it to be executed, we need to
compile with -sASYNCIFY=1(Asyncify) or
-sASYNCIFY=2(JSPI). Compiling with Asyncify is currently
not possible, due to the use of exceptions in some of the libraries we
use and consume. Compiling with JSPI is possible, though this limits us
to only being able to support Chromium-based engines, only if the user
enables the JSPI feature flag. Therefore, we're deciding on waiting
until JSPI is standard across all modern browsers, so that we can
attempt a rewrite, without having to completely disable exceptions.
Tips
Creating a compliant renderer
Here is a checklist for nice-to-have features we recommend you implement in your renderer:
- Supporting V-Sync from the renderer settings
- Supporting MSAA from the renderer settings
- Supporting texture filtering in your custom texture renderers
- Fill the renderer metadata strings if possible
- Using
ImGui::GetStyle().Colors[ImGuiCol_WindowBg]as the clear colour - Implementing robust framebuffer resizing
- For custom dear imgui renderer backends(when using renderer
abstractions like bgfx):
- Adding support for multi-viewports
- Supporting the dynamic font API from dear imgui 1.92
- Home
- Beginner content
- Install guide
- Creating and using the UI components
- The Instance
- The Init Info struct
- Building better titlebar menus
- Textures
- Logging
- Unicode support
- Additional features
- Client-side bar
- Custom type definitions
- Memory management
- C API development
- Config files and Folders
- Interfaces
- Internal Event safety
- Customising the build system
- Modules system
- Collaborating with others
- Advanced content
- Loading dynamic libraries at runtime
- Understanding the library layout
- Compilation mode modifiers
- Supporting plugins
- Production export and deployment
- OS integration tips
- Targeting WASM
- Using a custom rendering engine:
- Using a custom windowing backend:
- Developer and contributor resources
- Misc