Examples

There are a number of examples for custom renderers in the UntitledImGuiFramework that you can use:

  1. Basic OpenGL - Built-in OpenGL renderer
  2. Basic Vulkan - Built-in Vulkan renderer
  3. Basic WebGPU - Built-in WebGPU renderer
  4. 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:

  1. Supporting V-Sync from the renderer settings
  2. Supporting MSAA from the renderer settings
  3. Supporting texture filtering in your custom texture renderers
  4. Fill the renderer metadata strings if possible
  5. Using ImGui::GetStyle().Colors[ImGuiCol_WindowBg] as the clear colour
  6. Implementing robust framebuffer resizing
  7. 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