8#include <unordered_map>
10namespace ZenitUI::Test
27 void registerEffect(std::string name);
38 size_t size)
override;
42 std::string_view fsPath,
43 std::string_view vsPath = {})
override;
45 std::string_view fsSource,
46 std::string_view vsSource = {})
override;
51 std::unordered_map<std::string, EffectHandle> effects_;
52 std::unordered_map<std::string, TextureHandle> textures_;
53 uint32_t nextEffectId_{100};
54 uint32_t nextTextureId_{300};
Per-application state: renderer, platform, pointer, focus, portals.
Abstract name-based lookup and runtime lifecycle for textures and shaders.
Definition UIContext.hpp:449
In-memory IAssetProvider that mints synthetic texture and shader handles without touching the filesys...
Definition MockAssetProvider.hpp:23
TextureHandle loadTextureFromMemory(std::string_view name, const void *data, size_t size) override
Optional runtime hook to load a 2D texture from encoded image bytes in memory.
EffectHandle getEffect(std::string_view name) override
Look up a loaded shader effect by logical name; returns {0} if not found.
EffectHandle loadEffect(std::string_view name, std::string_view fsPath, std::string_view vsPath={}) override
Optional runtime hook to load a fragment (and optional vertex) shader from disk under name.
void unloadTexture(std::string_view name) override
Optional runtime hook to unload a texture by logical name.
void unloadEffect(std::string_view name) override
Optional runtime hook to unload a shader effect by logical name.
TextureHandle getTexture(std::string_view name) override
Look up a loaded 2D texture by logical name; returns {0} if not found.
EffectHandle loadEffectFromMemory(std::string_view name, std::string_view fsSource, std::string_view vsSource={}) override
Optional runtime hook to load a shader effect from in-memory source strings.
TextureHandle loadTexture(std::string_view name, std::string_view path) override
Optional runtime hook to load a 2D texture from disk under name.
Opaque handle to a shader/effect owned by the asset provider.
Definition CoreTypes.hpp:142
Opaque handle to a GPU/software texture owned by the asset provider.
Definition CoreTypes.hpp:127