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

In-memory IAssetProvider that mints synthetic texture and shader handles without touching the filesystem or GPU. More...

#include <MockAssetProvider.hpp>

Inheritance diagram for ZenitUI::Test::MockAssetProvider:
[legend]

Public Member Functions

Test Registration Helpers
void registerEffect (std::string name)
IAssetProvider Overrides
TextureHandle getTexture (std::string_view name) override
 Look up a loaded 2D texture by logical name; returns {0} if not found.
EffectHandle getEffect (std::string_view name) override
 Look up a loaded shader effect by logical name; returns {0} if not found.
TextureHandle loadTexture (std::string_view name, std::string_view path) override
 Optional runtime hook to load a 2D texture from disk under name.
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.
void unloadTexture (std::string_view name) override
 Optional runtime hook to unload a texture by logical name.
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.
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.
void unloadEffect (std::string_view name) override
 Optional runtime hook to unload a shader effect by logical name.
Public Member Functions inherited from ZenitUI::IAssetProvider
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.

Detailed Description

In-memory IAssetProvider that mints synthetic texture and shader handles without touching the filesystem or GPU.

Member Function Documentation

◆ getEffect()

EffectHandle ZenitUI::Test::MockAssetProvider::getEffect ( std::string_view name)
overridevirtual

Look up a loaded shader effect by logical name; returns {0} if not found.

Implements ZenitUI::IAssetProvider.

◆ getTexture()

TextureHandle ZenitUI::Test::MockAssetProvider::getTexture ( std::string_view name)
overridevirtual

Look up a loaded 2D texture by logical name; returns {0} if not found.

Implements ZenitUI::IAssetProvider.

◆ loadEffect()

EffectHandle ZenitUI::Test::MockAssetProvider::loadEffect ( std::string_view ,
std::string_view ,
std::string_view = {} )
overridevirtual

Optional runtime hook to load a fragment (and optional vertex) shader from disk under name.

Reimplemented from ZenitUI::IAssetProvider.

◆ loadEffectFromMemory()

EffectHandle ZenitUI::Test::MockAssetProvider::loadEffectFromMemory ( std::string_view ,
std::string_view ,
std::string_view = {} )
overridevirtual

Optional runtime hook to load a shader effect from in-memory source strings.

Reimplemented from ZenitUI::IAssetProvider.

◆ loadTexture()

TextureHandle ZenitUI::Test::MockAssetProvider::loadTexture ( std::string_view ,
std::string_view  )
overridevirtual

Optional runtime hook to load a 2D texture from disk under name.

Reimplemented from ZenitUI::IAssetProvider.

◆ loadTextureFromMemory()

TextureHandle ZenitUI::Test::MockAssetProvider::loadTextureFromMemory ( std::string_view ,
const void * ,
size_t  )
overridevirtual

Optional runtime hook to load a 2D texture from encoded image bytes in memory.

Reimplemented from ZenitUI::IAssetProvider.

◆ unloadEffect()

void ZenitUI::Test::MockAssetProvider::unloadEffect ( std::string_view )
overridevirtual

Optional runtime hook to unload a shader effect by logical name.

Reimplemented from ZenitUI::IAssetProvider.

◆ unloadTexture()

void ZenitUI::Test::MockAssetProvider::unloadTexture ( std::string_view )
overridevirtual

Optional runtime hook to unload a texture by logical name.

Reimplemented from ZenitUI::IAssetProvider.


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