It is mostly intended for debug and quick prototypes, but I want to extend its scope in the future. This library was written in C++17 to use the helpful std::string_view so we can avoid allocations.
It is an immediate mode, so you have to first setup its state like this
dui::State state{renderer};
Then send events to it:
while (SDL_PollEvent(&ev)) {
state.event(ev);
...
}
Then define your elements:
auto f = dui::frame(state);
dui::label(f, "Hello World", {100, 200});
if (dui::button(f, "Click me", {100, 220})) {
// do some action
}
And finally when finish all these things, render the frame:
//SDL_RenderClear() & co.
f.render();
The library is header only and it even has a single header file version too. It is hosted at https://github.com/talesm/dui, there you can also find a quick tutorial on the README and some examples under the examples directory.