Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CShaderUniforms Class Reference

Represents a mapping of name strings to value CVector4Ds, for use with uniforms in shaders. More...

#include <ShaderDefines.h>

Inheritance diagram for CShaderUniforms:
Collaboration diagram for CShaderUniforms:

Public Member Functions

void Add (const char *name, const CVector4D &value)
 Add a name and associated value to the map of uniforms. More...
 
CVector4D GetVector (const char *name) const
 Return the value for the given name, or (0,0,0,0) if not defined. More...
 
void BindUniforms (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, Renderer::Backend::IShaderProgram *shader) const
 Bind the collection of uniforms onto the given shader. More...
 
- Public Member Functions inherited from CShaderParams< CVector4D >
 CShaderParams ()
 Create an empty map of defines. More...
 
void Set (CStrIntern name, const CVector4D &value)
 Add a name and associated value to the map of parameters. More...
 
void SetMany (const CShaderParams &params)
 Add all the names and values from another set of parameters. More...
 
std::map< CStrIntern, CVector4DGetMap () const
 Return a copy of the current name/value mapping. More...
 
size_t GetHash () const
 Return a hash of the current mapping. More...
 
bool operator< (const CShaderParams &b) const
 Compare with some arbitrary total order. More...
 
bool operator== (const CShaderParams &b) const
 Fast equality comparison. More...
 
bool operator!= (const CShaderParams &b) const
 Fast inequality comparison. More...
 

Additional Inherited Members

- Protected Attributes inherited from CShaderParams< CVector4D >
SItems * m_Items
 

Detailed Description

Represents a mapping of name strings to value CVector4Ds, for use with uniforms in shaders.

Not thread-safe - must only be used from the main thread.

Member Function Documentation

◆ Add()

void CShaderUniforms::Add ( const char *  name,
const CVector4D value 
)

Add a name and associated value to the map of uniforms.

If the name is already defined, its value will be replaced.

◆ BindUniforms()

void CShaderUniforms::BindUniforms ( Renderer::Backend::IDeviceCommandContext deviceCommandContext,
Renderer::Backend::IShaderProgram shader 
) const

Bind the collection of uniforms onto the given shader.

◆ GetVector()

CVector4D CShaderUniforms::GetVector ( const char *  name) const

Return the value for the given name, or (0,0,0,0) if not defined.


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