|
ZenitUI
Retained-mode C++20 UI framework
|
Unified window, frame-loop, and subsystem host for interchangeable backends. More...
#include <Backend.hpp>
Public Member Functions | |
| virtual bool | init (const WindowConfig &config)=0 |
| Create the window and graphics context, and bind subsystems to UIContext. | |
| virtual void | shutdown ()=0 |
| Release pooled targets, unbind UIContext, and tear down the window/context. | |
| virtual bool | pollFrame ()=0 |
| Pump OS events for the next frame; returns false when the window should close. | |
| virtual float | deltaTime () const =0 |
| Return the elapsed time in seconds since the previous pollFrame(). | |
| virtual void | beginDraw (Color clearColor)=0 |
| Begin presenting a frame and clear the main framebuffer to clearColor. | |
| virtual void | endDraw ()=0 |
| Finish the frame and swap buffers. | |
| virtual std::string_view | name () const =0 |
| Short human-readable backend identifier (e.g. | |
| virtual IPlatform & | platform ()=0 |
| Access the underlying platform adapter. | |
| virtual IRenderer & | renderer ()=0 |
| Access the underlying renderer adapter. | |
| virtual IAssetProvider & | assets ()=0 |
| Access the underlying asset provider. | |
| void | bindTo (UIContext &ctx) |
Attach this backend's adapters to ctx, unbinding any previous context. | |
| void | unbind () |
| Flush pooled targets and detach this backend from its bound context. | |
| UIContext * | boundContext () const |
| Return the currently bound UIContext, or nullptr if unbound. | |
| bool | initAndBind (const WindowConfig &config, UIContext &ctx) |
Initialize the backend and bind its adapters to ctx in one step. | |
Protected Attributes | |
| UIContext * | boundCtx_ {nullptr} |
Unified window, frame-loop, and subsystem host for interchangeable backends.
|
pure virtual |
Access the underlying asset provider.
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.
|
pure virtual |
Begin presenting a frame and clear the main framebuffer to clearColor.
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.
|
pure virtual |
Return the elapsed time in seconds since the previous pollFrame().
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.
|
pure virtual |
Finish the frame and swap buffers.
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.
|
pure virtual |
Create the window and graphics context, and bind subsystems to UIContext.
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.
|
pure virtual |
Short human-readable backend identifier (e.g.
"Raylib", "SDL3 + OpenGL 3.3").
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.
|
pure virtual |
Access the underlying platform adapter.
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.
|
pure virtual |
Pump OS events for the next frame; returns false when the window should close.
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.
|
pure virtual |
Access the underlying renderer adapter.
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.
|
pure virtual |
Release pooled targets, unbind UIContext, and tear down the window/context.
Implemented in ZenitUI::RaylibBackend, ZenitUI::SDL3Backend, and ZenitUI::Test::MockBackend.