TDME2 1.9.121
Public Member Functions | Private Member Functions | Private Attributes | List of all members
EntityShaderParameters Class Reference

TDME2 engine entity shader parameters. More...

#include <tdme/engine/EntityShaderParameters.h>

Collaboration diagram for EntityShaderParameters:
Collaboration graph

Public Member Functions

 EntityShaderParameters ()
 Public constructor. More...
 
 ~EntityShaderParameters ()
 Destructor. More...
 
void setShader (const string &shaderId)
 Set shader. More...
 
const ShaderParameter getShaderParameter (const string &parameterName) const
 Returns shader parameter for given parameter name, if the value does not exist, the default will be returned. More...
 
void setShaderParameter (const string &parameterName, const ShaderParameter &parameterValue)
 Set shader parameter for given parameter name. More...
 
void setShaderParameter (const string &parameterName, const string &parameterValueString)
 Set shader parameter for given parameter name. More...
 
const string & getShaderParametersHash () const
 

Private Member Functions

void computeHash ()
 Compute shader parameters hash. More...
 

Private Attributes

map< string, ShaderParameterparameters
 
string shaderId
 
string hash
 
bool changed { false }
 

Detailed Description

TDME2 engine entity shader parameters.

Author
Andreas Drewke
Version
$Id$

Definition at line 20 of file EntityShaderParameters.h.

Constructor & Destructor Documentation

◆ EntityShaderParameters()

Public constructor.

Definition at line 38 of file EntityShaderParameters.h.

◆ ~EntityShaderParameters()

Destructor.

Definition at line 44 of file EntityShaderParameters.h.

Member Function Documentation

◆ computeHash()

void computeHash ( )
private

Compute shader parameters hash.

◆ getShaderParameter()

const ShaderParameter getShaderParameter ( const string &  parameterName) const

Returns shader parameter for given parameter name, if the value does not exist, the default will be returned.

Parameters
shaderIdshader id
parameterNameparameter name
Returns
shader parameter

Definition at line 30 of file EntityShaderParameters.cpp.

◆ getShaderParametersHash()

const string & getShaderParametersHash ( ) const
inline
Returns
shader parameters hash

Definition at line 86 of file EntityShaderParameters.h.

◆ setShader()

void setShader ( const string &  shaderId)
inline

Set shader.

Parameters
shaderIdshader id

Definition at line 51 of file EntityShaderParameters.h.

◆ setShaderParameter() [1/2]

void setShaderParameter ( const string &  parameterName,
const ShaderParameter parameterValue 
)

Set shader parameter for given parameter name.

Parameters
shaderIdshader id
parameterNameparameter name
paraemterValueparameter value

Definition at line 39 of file EntityShaderParameters.cpp.

◆ setShaderParameter() [2/2]

void setShaderParameter ( const string &  parameterName,
const string &  parameterValueString 
)

Set shader parameter for given parameter name.

Parameters
shaderIdshader id
parameterNameparameter name
paraemterValueparameter value

Definition at line 52 of file EntityShaderParameters.cpp.

Member Data Documentation

◆ changed

bool changed { false }
mutableprivate

Definition at line 27 of file EntityShaderParameters.h.

◆ hash

string hash
mutableprivate

Definition at line 26 of file EntityShaderParameters.h.

◆ parameters

map<string, ShaderParameter> parameters
private

Definition at line 23 of file EntityShaderParameters.h.

◆ shaderId

string shaderId
private

Definition at line 24 of file EntityShaderParameters.h.


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