Menu

Designing a C++ desktop GUI toolkit where widgets never touch the GPU
πŸ“°

Designing a C++ desktop GUI toolkit where widgets never touch the GPU

DEV Community: cppΒ·ζ³½Β·about 3 hours ago
#ieUX0mR2
#devtocpp#devto#dev#include#ifdef
Reading 0:00
15s threshold

Writing a desktop app in C++ is supposed to be the easy case. You have a compiler, a debugger, and thirty years of platform APIs behind you.

In practice, the UI is where projects stall. Not because buttons are hard, but because everything under the buttons is a separate project: window creation, the message loop, mouse and keyboard routing, clipboard, IME candidate window placement, a swapchain, font rasterization, image decoding. Each piece is a week of work. Each piece has to be done twice if you want Windows and Linux. And none of it is the thing you actually wanted to build.

Zekit is my attempt to do that layer once. It's a C++20 GUI toolkit that compiles to a single static library β€” window, GPU renderer, widget set, layout, text, IME. You include one header and link one lib.

Below is the one design rule everything else hangs off, plus a few things I got wrong on the way.

The rule: widgets never touch the GPU

A widget's job is to describe what this frame looks like.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.