|
ZenitUI
Retained-mode C++20 UI framework
|
Abstract name-based lookup and runtime lifecycle for textures and shaders. More...
#include <UIContext.hpp>
Public Member Functions | |
| virtual TextureHandle | getTexture (std::string_view name)=0 |
| Look up a loaded 2D texture by logical name; returns {0} if not found. | |
| virtual EffectHandle | getEffect (std::string_view name)=0 |
| Look up a loaded shader effect by logical name; returns {0} if not found. | |
| virtual TextureHandle | loadTexture (std::string_view, std::string_view) |
| Optional runtime hook to load a 2D texture from disk under name. | |
| virtual TextureHandle | loadTextureFromMemory (std::string_view, const void *, size_t) |
| Optional runtime hook to load a 2D texture from encoded image bytes in memory. | |
| virtual void | unloadTexture (std::string_view) |
| Optional runtime hook to unload a texture by logical name. | |
| virtual EffectHandle | loadEffect (std::string_view, std::string_view, std::string_view={}) |
| Optional runtime hook to load a fragment (and optional vertex) shader from disk under name. | |
| virtual EffectHandle | loadEffectFromMemory (std::string_view, std::string_view, std::string_view={}) |
| Optional runtime hook to load a shader effect from in-memory source strings. | |
| EffectHandle | loadEffectAsset (std::string_view name, std::string_view baseDir, std::string_view fileStem, ShaderLanguage lang) |
Load a shader effect by stem fileStem under baseDir, resolving the file extension from lang (e.g. | |
| virtual void | unloadEffect (std::string_view) |
| Optional runtime hook to unload a shader effect by logical name. | |
Abstract name-based lookup and runtime lifecycle for textures and shaders.
Lookup methods (getTexture, getEffect) are called frequently during layout and draw; implementations should avoid heap allocations (e.g. via transparent std::string_view hashing). Return a default-constructed invalid handle (id == 0) when a requested asset is not registered.
See Writing a Custom Backend and Backends, TextEngine, UTF-8 & Debugging (RaylibAssetProvider, MockAssetProvider).
|
pure virtual |
Look up a loaded shader effect by logical name; returns {0} if not found.
Implemented in ZenitUI::RaylibAssetProvider, ZenitUI::SDL3AssetProvider, and ZenitUI::Test::MockAssetProvider.
|
pure virtual |
Look up a loaded 2D texture by logical name; returns {0} if not found.
Implemented in ZenitUI::RaylibAssetProvider, ZenitUI::SDL3AssetProvider, and ZenitUI::Test::MockAssetProvider.
|
inlinevirtual |
Optional runtime hook to load a fragment (and optional vertex) shader from disk under name.
Reimplemented in ZenitUI::RaylibAssetProvider, ZenitUI::SDL3AssetProvider, and ZenitUI::Test::MockAssetProvider.
|
inline |
Load a shader effect by stem fileStem under baseDir, resolving the file extension from lang (e.g.
baseDir/blur.fs for GLSL330, baseDir/spv/blur.frag.spv for SPIRV, baseDir/wgsl/blur.wgsl for WGSL).
|
inlinevirtual |
Optional runtime hook to load a shader effect from in-memory source strings.
Reimplemented in ZenitUI::RaylibAssetProvider, ZenitUI::SDL3AssetProvider, and ZenitUI::Test::MockAssetProvider.
|
inlinevirtual |
Optional runtime hook to load a 2D texture from disk under name.
Reimplemented in ZenitUI::RaylibAssetProvider, ZenitUI::SDL3AssetProvider, and ZenitUI::Test::MockAssetProvider.
|
inlinevirtual |
Optional runtime hook to load a 2D texture from encoded image bytes in memory.
Reimplemented in ZenitUI::RaylibAssetProvider, ZenitUI::SDL3AssetProvider, and ZenitUI::Test::MockAssetProvider.
|
inlinevirtual |
Optional runtime hook to unload a shader effect by logical name.
Reimplemented in ZenitUI::RaylibAssetProvider, ZenitUI::SDL3AssetProvider, and ZenitUI::Test::MockAssetProvider.
|
inlinevirtual |
Optional runtime hook to unload a texture by logical name.
Reimplemented in ZenitUI::RaylibAssetProvider, ZenitUI::SDL3AssetProvider, and ZenitUI::Test::MockAssetProvider.