Skip to content
PRISM-GUIPublic

About

PRISM — C++26 UI toolkit: parallel rendering, retained scene graph, lock-free threading

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

PRISM logo

Persistent Rendering & Interactive Scene Model

A from-scratch C++26 GUI framework. Write a struct, get a UI.
The renderer runs on its own thread, so slow app code never freezes the window.

CI Live demos Documentation C++26 | C++23 MIT license

Warning

PRISM is an R&D project. Nothing here is production-ready yet.

A plain C++ struct on the left and the UI PRISM makes from it on the right: each member's line points at its labelled row (text field, number, checkbox, dropdown, number)

#include <prism/prism.hpp>
using namespace prism;   // the snippets below assume it: names read core::Field, ui::Slider, app::run

struct Counter {
    core::Field<int> count{42};
    core::Field<std::string> label{"Hello, PRISM!"};
};

int main() {
    Counter counter;
    return app::run(counter, {.title = "My App"});   // C++26 reflection builds the UI
}

Counter app

Try it without installing anything: the live demos run the real examples, compiled to WebAssembly.

Why PRISM

Qt, GTK and wxWidgets run your code and the renderer on the same thread. If one callback is slow, nothing else happens. The window cannot repaint, cannot resize, and looks frozen.

PRISM puts the renderer on a separate thread. Your code still blocks its own thread, but the window stays alive.

Timeline: a 40 ms callback freezes a single-threaded toolkit for two frames; in PRISM the render thread keeps serving OS events from the last snapshot

This is an architectural choice, not a tuning trick. It is built in from day one.

Documentation

The manual is on prism-gui.readthedocs.io. It starts with a tour and ends with a reference for every widget and type, each with an example. Its pages are Markdown in doc/.

Start Concepts Widgets The app
Why PRISM The model All widgets Windows
Install Views and layout Controls Themes
Your first app Blocks Tables, trees, lists Settings
Examples Threads Text and code Python

Examples

examples/tour/ is the place to start: five programs of 20 to 40 lines, one idea each. examples/ holds eight complete apps, from a widget gallery to a synthesizer and a SQL tool; all of them run in the browser.

Widget Gallery

The same model runs elsewhere:

  • Python: the SDK builds a prism extension from python/: a class of fields is a window, and any thread may change a field.
  • Boards: embedded covers the ports that ship: the STM32H7B3I-DK and STM32F746G-DISCO, and the ESP32-S31-Korvo-1.

Building

You need Meson ≥ 1.5 and a recent C++ compiler. All dependencies are fetched as Meson wraps.

meson setup builddir
ninja -C builddir
meson test -C builddir
Compiler Reflection What you write
GCC 16+ yes, -freflection is auto-detected nothing: structs become UIs
GCC 14+, Clang 17+ no one view() method per model

The browser build, the WebGPU renderer and the four entry points are in Install.

License

MIT

About

PRISM — C++26 UI toolkit: parallel rendering, retained scene graph, lock-free threading

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages