HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_ShaderAtlas Class Reference

#include <RE_ShaderAtlas.h>

+ Inheritance diagram for RE_ShaderAtlas:

Public Member Functions

 RE_ShaderAtlas (const UT_StringRef &shader_atlas_file)
 
virtual ~RE_ShaderAtlas ()
 
bool loadAtlas ()
 
exint getBit (const UT_StringRef &tag) const
 
RE_ShadergetShader (RE_Render *r, exint shbits) const
 
const UT_StringHoldergetFilePath () const
 
const UT_Map< exint,
RE_ShaderHandlePtr > & 
shaders () const
 
const UT_StringMap< exint > & bits () const
 
void printTags (exint tags)
 

Protected Member Functions

void applyDefsToMatchingShaders (const UT_StringArray &tag_stack, UT_WorkBuffer &defines)
 
void addShader (const UT_StringArray &tag_stack, const UT_StringArray &tokens, const UT_StringHolder &program, UT_WorkBuffer &defines)
 
bool addShader (exint key, const UT_StringHolder &program, const UT_StringHolder &defines, bool check_for_abs_path)
 
virtual RE_ShaderHandlePtr createShaderImpl (const char *program, const char *defines)
 
exint registerTokens (const UT_StringArray &tokens)
 

Protected Attributes

UT_Map< exint, RE_ShaderHandlePtrmyMap
 
UT_StringMap< exintmyBits
 
int myMaxBit
 
UT_StringHolder myAtlasFile
 
UT_StringHolder myAtlasDir
 
bool myAtlasLoaded
 
bool myAtlasValid
 

Detailed Description

A Shader Atlas is a collection of related shaders identified by tags. It has its own simple file format which associates .prog shader files with a set of tags. To retrieve that shader, supply the list of tags.

Definition at line 29 of file RE_ShaderAtlas.h.

Constructor & Destructor Documentation

RE_ShaderAtlas::RE_ShaderAtlas ( const UT_StringRef shader_atlas_file)
virtual RE_ShaderAtlas::~RE_ShaderAtlas ( )
virtual

Member Function Documentation

void RE_ShaderAtlas::addShader ( const UT_StringArray tag_stack,
const UT_StringArray tokens,
const UT_StringHolder program,
UT_WorkBuffer defines 
)
protected
bool RE_ShaderAtlas::addShader ( exint  key,
const UT_StringHolder program,
const UT_StringHolder defines,
bool  check_for_abs_path 
)
protected
void RE_ShaderAtlas::applyDefsToMatchingShaders ( const UT_StringArray tag_stack,
UT_WorkBuffer defines 
)
protected
const UT_StringMap<exint>& RE_ShaderAtlas::bits ( ) const
inline

Definition at line 50 of file RE_ShaderAtlas.h.

virtual RE_ShaderHandlePtr RE_ShaderAtlas::createShaderImpl ( const char *  program,
const char *  defines 
)
protectedvirtual

Reimplemented in RV_ShaderAtlas.

exint RE_ShaderAtlas::getBit ( const UT_StringRef tag) const
const UT_StringHolder& RE_ShaderAtlas::getFilePath ( ) const
inline

Definition at line 46 of file RE_ShaderAtlas.h.

RE_Shader* RE_ShaderAtlas::getShader ( RE_Render r,
exint  shbits 
) const
bool RE_ShaderAtlas::loadAtlas ( )
void RE_ShaderAtlas::printTags ( exint  tags)
exint RE_ShaderAtlas::registerTokens ( const UT_StringArray tokens)
protected
const UT_Map<exint, RE_ShaderHandlePtr>& RE_ShaderAtlas::shaders ( ) const
inline

Definition at line 49 of file RE_ShaderAtlas.h.

Member Data Documentation

UT_StringHolder RE_ShaderAtlas::myAtlasDir
protected

Definition at line 74 of file RE_ShaderAtlas.h.

UT_StringHolder RE_ShaderAtlas::myAtlasFile
protected

Definition at line 73 of file RE_ShaderAtlas.h.

bool RE_ShaderAtlas::myAtlasLoaded
protected

Definition at line 75 of file RE_ShaderAtlas.h.

bool RE_ShaderAtlas::myAtlasValid
protected

Definition at line 76 of file RE_ShaderAtlas.h.

UT_StringMap<exint> RE_ShaderAtlas::myBits
protected

Definition at line 70 of file RE_ShaderAtlas.h.

UT_Map<exint, RE_ShaderHandlePtr> RE_ShaderAtlas::myMap
protected

Definition at line 69 of file RE_ShaderAtlas.h.

int RE_ShaderAtlas::myMaxBit
protected

Definition at line 71 of file RE_ShaderAtlas.h.


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