SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::RenderEngine::ResourceManager Class Reference

#include <ResourceManager.hpp>

Static Public Member Functions

static BufferBaseCreateBuffer (BufferType Type, uint32_t Size, void *Data)
 Creates a buffer via the currently registered backend factory.
static Sleak::TextureCreateCubemapTexture (const std::array< std::string, 6 > &FacePaths)
 Loads a cubemap from six face image paths via the currently registered backend factory.
static Sleak::TextureCreateCubemapTextureFromPanorama (const std::string &PanoramaPath)
 Loads a cubemap from a single equirectangular panorama via the currently registered backend factory.
static ShaderCreateShader (const std::string &ShaderPath)
 Compiles a shader via the currently registered backend factory.
static Sleak::TextureCreateTexture (const std::string &TexturePath)
 Loads a texture via the currently registered backend factory.
static Sleak::TextureCreateTextureFromMemory (const void *data, uint32_t width, uint32_t height, TextureFormat format, uint32_t maxMipLevels=0)
 Creates a texture from raw pixel data via the currently registered backend factory.
template<typename T>
static void RegisterCreateBuffer (T *instance, BufferBase *(T::*method)(BufferType, uint32_t, void *))
template<typename T>
static void RegisterCreateCubemapTexture (T *instance, Texture *(T::*method)(const std::array< std::string, 6 > &))
template<typename T>
static void RegisterCreateCubemapTextureFromPanorama (T *instance, Texture *(T::*method)(const std::string &))
template<typename T>
static void RegisterCreateShader (T *instance, Shader *(T::*method)(const std::string &))
template<typename T>
static void RegisterCreateTexture (T *instance, Texture *(T::*method)(const std::string &))
static void RegisterCreateTextureFromMemory (std::function< Texture *(const void *, uint32_t, uint32_t, TextureFormat, uint32_t)> func)

Detailed Description

Backend-agnostic factory: routes buffer/shader/texture creation to whichever backend registered its creation functions at startup.

Definition at line 35 of file ResourceManager.hpp.

Member Function Documentation

◆ CreateBuffer()

BufferBase * Sleak::RenderEngine::ResourceManager::CreateBuffer ( BufferType Type,
uint32_t Size,
void * Data )
static

Creates a buffer via the currently registered backend factory.

Definition at line 9 of file ResourceManager.cpp.

◆ CreateCubemapTexture()

Sleak::Texture * Sleak::RenderEngine::ResourceManager::CreateCubemapTexture ( const std::array< std::string, 6 > & FacePaths)
static

Loads a cubemap from six face image paths via the currently registered backend factory.

Definition at line 83 of file ResourceManager.cpp.

◆ CreateCubemapTextureFromPanorama()

Sleak::Texture * Sleak::RenderEngine::ResourceManager::CreateCubemapTextureFromPanorama ( const std::string & PanoramaPath)
static

Loads a cubemap from a single equirectangular panorama via the currently registered backend factory.

Definition at line 102 of file ResourceManager.cpp.

◆ CreateShader()

Shader * Sleak::RenderEngine::ResourceManager::CreateShader ( const std::string & ShaderPath)
static

Compiles a shader via the currently registered backend factory.

Definition at line 27 of file ResourceManager.cpp.

◆ CreateTexture()

Sleak::Texture * Sleak::RenderEngine::ResourceManager::CreateTexture ( const std::string & TexturePath)
static

Loads a texture via the currently registered backend factory.

Definition at line 45 of file ResourceManager.cpp.

◆ CreateTextureFromMemory()

Sleak::Texture * Sleak::RenderEngine::ResourceManager::CreateTextureFromMemory ( const void * data,
uint32_t width,
uint32_t height,
TextureFormat format,
uint32_t maxMipLevels = 0 )
static

Creates a texture from raw pixel data via the currently registered backend factory.

Definition at line 64 of file ResourceManager.cpp.

◆ RegisterCreateBuffer()

template<typename T>
void Sleak::RenderEngine::ResourceManager::RegisterCreateBuffer ( T * instance,
BufferBase *(T::* method )(BufferType, uint32_t, void *) )
inlinestatic

Definition at line 39 of file ResourceManager.hpp.

◆ RegisterCreateCubemapTexture()

template<typename T>
void Sleak::RenderEngine::ResourceManager::RegisterCreateCubemapTexture ( T * instance,
Texture *(T::* method )(const std::array< std::string, 6 > &) )
inlinestatic

Definition at line 74 of file ResourceManager.hpp.

◆ RegisterCreateCubemapTextureFromPanorama()

template<typename T>
void Sleak::RenderEngine::ResourceManager::RegisterCreateCubemapTextureFromPanorama ( T * instance,
Texture *(T::* method )(const std::string &) )
inlinestatic

Definition at line 83 of file ResourceManager.hpp.

◆ RegisterCreateShader()

template<typename T>
void Sleak::RenderEngine::ResourceManager::RegisterCreateShader ( T * instance,
Shader *(T::* method )(const std::string &) )
inlinestatic

Definition at line 48 of file ResourceManager.hpp.

◆ RegisterCreateTexture()

template<typename T>
void Sleak::RenderEngine::ResourceManager::RegisterCreateTexture ( T * instance,
Texture *(T::* method )(const std::string &) )
inlinestatic

Definition at line 57 of file ResourceManager.hpp.

◆ RegisterCreateTextureFromMemory()

void Sleak::RenderEngine::ResourceManager::RegisterCreateTextureFromMemory ( std::function< Texture *(const void *, uint32_t, uint32_t, TextureFormat, uint32_t)> func)
inlinestatic

Definition at line 65 of file ResourceManager.hpp.