32 std::string title{
"ZenitUI"};
72 virtual std::string_view
name()
const = 0;
86 if (boundCtx_ == &ctx)
96 boundCtx_->detachBackend();
Per-application state: renderer, platform, pointer, focus, portals.
Abstract name-based lookup and runtime lifecycle for textures and shaders.
Definition UIContext.hpp:449
Unified window, frame-loop, and subsystem host for interchangeable backends.
Definition Backend.hpp:49
virtual IPlatform & platform()=0
Access the underlying platform adapter.
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.
bool initAndBind(const WindowConfig &config, UIContext &ctx)
Initialize the backend and bind its adapters to ctx in one step.
Definition Backend.hpp:103
void bindTo(UIContext &ctx)
Attach this backend's adapters to ctx, unbinding any previous context.
Definition Backend.hpp:84
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.
void unbind()
Flush pooled targets and detach this backend from its bound context.
Definition Backend.hpp:93
virtual IAssetProvider & assets()=0
Access the underlying asset provider.
virtual std::string_view name() const =0
Short human-readable backend identifier (e.g.
virtual IRenderer & renderer()=0
Access the underlying renderer adapter.
UIContext * boundContext() const
Return the currently bound UIContext, or nullptr if unbound.
Definition Backend.hpp:100
Abstract 2D rendering backend.
Definition UIContext.hpp:106
8-bit-per-channel RGBA color, non-premultiplied.
Definition CoreTypes.hpp:78
Per-instance UI context: backends, theme, text engine, frame state, and routing.
Definition UIContext.hpp:725
void attachBackend(IRenderer *r, IPlatform *p, IAssetProvider *a, UIContext **ownerSlot=nullptr)
Attach renderer, platform, and asset backends to this context.
Definition UIContext.hpp:747
Backend-agnostic window and graphics-context creation parameters.
Definition Backend.hpp:31
int targetFps
Hint for backends with built-in frame pacing (0 = uncapped/vsync).
Definition Backend.hpp:37