SLProject 4.0.000
SLGLProgramManager Class Reference

Static container for standard shader programs. More...

#include <SLGLProgramManager.h>

Static Public Member Functions

static void init (string shaderPath, string configPath)
 Init by providing path to standard shader files. More...
 
static SLGLProgramGenericget (SLStdShaderProg id)
 Get program reference for given id. More...
 
static void deletePrograms ()
 Delete all instantiated programs. More...
 
static size_t size ()
 Returns the size of the program map. More...
 

Static Public Attributes

static string shaderPath
 Contains the global shader path. More...
 
static string configPath
 Contains the global writable configuration path;. More...
 

Static Private Member Functions

static void makeProgram (SLStdShaderProg id)
 Make a program if it is not contained in _programs. More...
 

Static Private Attributes

static std::map< SLStdShaderProg, SLGLProgramGeneric * > _programs
 Instantiated programs. More...
 

Detailed Description

Static container for standard shader programs.

Static container for standard shader programs that are not deleted after scene deallocation. The shader program allocation and compilation will be done at the first use. ONLY shader programs that are scene independent should be stored here. Shader programs that depend e.g. on the number of lights must be created at scene loading time and deallocation at scene destruction.

Member Function Documentation

◆ deletePrograms()

void SLGLProgramManager::deletePrograms ( )
static

Delete all instantiated programs.

◆ get()

SLGLProgramGeneric * SLGLProgramManager::get ( SLStdShaderProg  id)
static

Get program reference for given id.

◆ init()

void SLGLProgramManager::init ( string  shdrPath,
string  confPath 
)
static

Init by providing path to standard shader files.

Parameters
shdrPathPath to the shader files
confPathPath to the writable config directory

◆ makeProgram()

void SLGLProgramManager::makeProgram ( SLStdShaderProg  id)
staticprivate

Make a program if it is not contained in _programs.

◆ size()

static size_t SLGLProgramManager::size ( )
inlinestatic

Returns the size of the program map.

Member Data Documentation

◆ _programs

std::map< SLStdShaderProg, SLGLProgramGeneric * > SLGLProgramManager::_programs
staticprivate

Instantiated programs.

◆ configPath

string SLGLProgramManager::configPath
static

Contains the global writable configuration path;.

◆ shaderPath

string SLGLProgramManager::shaderPath
static

Contains the global shader path.


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