One UI Path to Rule Them All: SDL + wgpu Everywhere

· 3 min read · DeanoC

One UI Path to Rule Them All: SDL + wgpu Everywhere (and goodbye ImGui)



Over the last cycle we finished a pretty major internal shift: the main branch now runs a single custom renderer + UI stack across all supported platforms.

That means:

  • SDL for windowing/input where applicable

  • wgpu as the unified rendering backend

  • our custom UI system as the only UI layer

  • and no more legacy ImGui dependencies or codepaths


  • What changed (high level)



    Historically we had multiple UI/rendering paths depending on platform and build target, plus legacy ImGui glue that inevitably drifted over time. With this merge, the project now has one primary pipeline:

  • Platform integration (SDL + platform-specific bits where required)

  • wgpu render loop

  • custom UI rendering/layout

  • the same UI behavior across platforms, because it’s literally the same codepath


  • There are still platform-specific details (there always are), but they now live around the edges instead of fracturing the core.

    Why we did it



    This wasn’t refactoring for its own sake. The goal was to make the project faster to evolve and easier to reason about:

  • Consistency: UI/UX should behave the same on desktop, mobile, and web targets

  • Maintainability: one codepath is dramatically easier to keep correct

  • Fewer dependencies: removing ImGui means less surface area, less glue code, fewer “why is this different here?” moments

  • Feature velocity: when the UI system improves, it improves everywhere


  • What this unlocks next



    Now that the architecture is unified, we can focus on the work that’s worth doing:

  • better UI components and polish in the custom UI system

  • shared UX patterns across platforms (not three versions of “the same” screen)

  • more predictable rendering + input behavior

  • cleaner profiling and performance work (because we’re not comparing apples to oranges across platforms)


  • Current status: performance tuning is the next big push



    We’re seeing some performance issues, and our current suspicion is that some work that should be off the main thread isn’t (or we’re blocking in places we shouldn’t be). The good news: we already have ztracy integrated, so we can start turning “it feels slow” into “this is the exact stall and why.”

    In the coming work, expect a lot of:

  • measuring frame time breakdowns

  • finding thread/blocking stalls

  • moving heavy or bursty tasks off the main thread where possible

  • tightening the render loop and UI update cadence


  • What we’d love feedback on



    If you’re using main, the most useful reports right now are:

  • platform + GPU details

  • what action causes the hitch (scrolling, opening a panel, resizing, first render, etc.)

  • any reproducible steps

  • a short trace / capture if you’re comfortable sharing one


  • TL;DR



    Main now runs a single SDL + wgpu + custom UI path across platforms, with legacy ImGui removed. This is a big simplification that should pay off in stability and feature velocity. Next up: profiling and performance work with ztracy.