HoviTron Video Pipeline
Public Member Functions | Static Public Member Functions
ShadersList Class Reference

Class that loads SPIR-V shader from files and make their content available to the rest of the code. More...

#include <Shader.h>

Public Member Functions

Shader const & operator() (const char *name) const
 
void loadShaders ()
 

Static Public Member Functions

static ShadersListgetInstance ()
 

Detailed Description

Class that loads SPIR-V shader from files and make their content available to the rest of the code.

Class that loads SPIR-V shader from files and make their content available to the rest of the code. On desktop, files are expected to be located in a folder called "shader" placed near the executable In android, the shader are often located with the assets so the process is slightly modified to fit this platform ShaderList class is a singleton and will therefore only be created once.

Definition at line 63 of file Shader.h.

Member Function Documentation

◆ getInstance()

ShadersList & ShadersList::getInstance ( )
static

Return an instance of ShadersList

Definition at line 99 of file Shader.cpp.

99 {
100 static ShadersList singleton;
101 return singleton;
102}
Class that loads SPIR-V shader from files and make their content available to the rest of the code.
Definition: Shader.h:64

◆ loadShaders()

void ShadersList::loadShaders ( )

Load the shaders defined in the private attribute "namesList" from the disk

Definition at line 68 of file Shader.cpp.

69{
70
71 for (auto & shaderName : namesList) {
72 readShader(shaderName);
73 }
74}

◆ operator()()

Shader const & ShadersList::operator() ( const char *  name) const

Allow to access the map containing the shaders using () operator

Definition at line 103 of file Shader.cpp.

104{
105 return m_shaders.at(name);
106}

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