fluidvis
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sx::Uniform Class Referenceabstract

#include <SXCore.h>

Inheritance diagram for sx::Uniform:
sx::SXResource sx::Texture sx::UniformDMatrix sx::UniformDouble sx::UniformDVector sx::UniformFloat sx::UniformMatrix sx::UniformVector sx::Volume

Public Member Functions

virtual EX ~Uniform ()
 
EX void setUniformName (const string &name, const string &id)
 
EX const string & getUniformName (const string &id) const
 
virtual void use (Shader &shader, const string &id)=0
 
- Public Member Functions inherited from sx::SXResource
virtual EX ~SXResource ()
 
EX const string & getID () const
 
virtual bool isLoaded () const =0
 
virtual void load ()=0
 

Protected Member Functions

EX Uniform (const string &id)
 

Protected Attributes

string idToken
 
unordered_map< string, string > uniformNames
 
- Protected Attributes inherited from sx::SXResource
string id
 

Detailed Description

a uniform variable

Constructor & Destructor Documentation

EX sx::Uniform::Uniform ( const string &  id)
protected

initializing this with identifier id, and uniformNames

virtual EX sx::Uniform::~Uniform ( )
virtual

deconstructor

Member Function Documentation

EX const string& sx::Uniform::getUniformName ( const string &  id) const

Returns the uniform name of the variable associated with id. If this association has not be specified yet with setUniformName, idToken is returned

EX void sx::Uniform::setUniformName ( const string &  name,
const string &  id 
)

sets the name of the uniform variable used in the shader, when the resource with identifyer id uses the uniform variable

virtual void sx::Uniform::use ( Shader shader,
const string &  id 
)
pure virtual

Submits the uniform variable to the specified shader. The uniform variable is accessible in the shader with the name set with setUniformName. If setUniformName has not been used, idToken is used as the uniform variable name.

Implemented in sx::Volume, sx::Texture, sx::UniformDMatrix, sx::UniformMatrix, sx::UniformDVector, sx::UniformVector, sx::UniformDouble, and sx::UniformFloat.

Member Data Documentation

string sx::Uniform::idToken
protected

last token of id with '.' being the the delimiter of the tokens in id

unordered_map<string,string> sx::Uniform::uniformNames
protected

mapping of the identifiers associating them with the names used by a certain resource


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