ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
ZenitUI::SDL3Backend Class Referencefinal

Unified IBackend host managing an SDL3 window, OpenGL 3.3 Core context, and SDL3Platform / SDL3Renderer / SDL3AssetProvider. More...

#include <SDL3Backend.hpp>

Inheritance diagram for ZenitUI::SDL3Backend:
[legend]

Public Member Functions

 SDL3Backend (const SDL3Backend &)=delete
SDL3Backend & operator= (const SDL3Backend &)=delete
bool init (const WindowConfig &config) override
 Create the window and graphics context, and bind subsystems to UIContext.
void shutdown () override
 Release pooled targets, unbind UIContext, and tear down the window/context.
bool pollFrame () override
 Pump OS events for the next frame; returns false when the window should close.
float deltaTime () const override
 Return the elapsed time in seconds since the previous pollFrame().
void beginDraw (Color clearColor) override
 Begin presenting a frame and clear the main framebuffer to clearColor.
void endDraw () override
 Finish the frame and swap buffers.
std::string_view name () const override
 Short human-readable backend identifier (e.g.
IPlatform & platform () override
 Access the underlying platform adapter.
IRenderer & renderer () override
 Access the underlying renderer adapter.
IAssetProvider & assets () override
 Access the underlying asset provider.
Public Member Functions inherited from ZenitUI::IBackend
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.

Additional Inherited Members

Protected Attributes inherited from ZenitUI::IBackend
UIContext * boundCtx_ {nullptr}

Detailed Description

Unified IBackend host managing an SDL3 window, OpenGL 3.3 Core context, and SDL3Platform / SDL3Renderer / SDL3AssetProvider.

Member Function Documentation

◆ assets()

IAssetProvider & ZenitUI::SDL3Backend::assets ( )
inlineoverridevirtual

Access the underlying asset provider.

Implements ZenitUI::IBackend.

◆ beginDraw()

void ZenitUI::SDL3Backend::beginDraw ( Color clearColor)
overridevirtual

Begin presenting a frame and clear the main framebuffer to clearColor.

Implements ZenitUI::IBackend.

◆ deltaTime()

float ZenitUI::SDL3Backend::deltaTime ( ) const
inlineoverridevirtual

Return the elapsed time in seconds since the previous pollFrame().

Implements ZenitUI::IBackend.

◆ endDraw()

void ZenitUI::SDL3Backend::endDraw ( )
overridevirtual

Finish the frame and swap buffers.

Implements ZenitUI::IBackend.

◆ init()

bool ZenitUI::SDL3Backend::init ( const WindowConfig & config)
overridevirtual

Create the window and graphics context, and bind subsystems to UIContext.

Implements ZenitUI::IBackend.

◆ name()

std::string_view ZenitUI::SDL3Backend::name ( ) const
inlineoverridevirtual

Short human-readable backend identifier (e.g.

"Raylib", "SDL3 + OpenGL 3.3").

Implements ZenitUI::IBackend.

◆ platform()

IPlatform & ZenitUI::SDL3Backend::platform ( )
inlineoverridevirtual

Access the underlying platform adapter.

Implements ZenitUI::IBackend.

◆ pollFrame()

bool ZenitUI::SDL3Backend::pollFrame ( )
overridevirtual

Pump OS events for the next frame; returns false when the window should close.

Implements ZenitUI::IBackend.

◆ renderer()

IRenderer & ZenitUI::SDL3Backend::renderer ( )
inlineoverridevirtual

Access the underlying renderer adapter.

Implements ZenitUI::IBackend.

◆ shutdown()

void ZenitUI::SDL3Backend::shutdown ( )
overridevirtual

Release pooled targets, unbind UIContext, and tear down the window/context.

Implements ZenitUI::IBackend.


The documentation for this class was generated from the following file: