Namespace: dmGameSystem
Language: C++
Type: Defold C++
File: render_constants.h
Source: engine/gamesys/src/dmsdk/gamesys/render_constants.h
Include: dmsdk/gamesys/render_constants.h
Api for setting and updating component render constants
Type: FUNCTION check if the constants have changed
Parameters
constants (dmGameSystem::HComponentRenderConstants) - the constantsReturns
result (int) - non zero if the constants were changedType: FUNCTION Removes a render constant from the container
Parameters
constants (dmGameSystem::HComponentRenderConstants) - the constantsname_hash (dmhash_t) - the hashed name of the constantReturns
result (int) - non zero if the constant was removedType: TYPEDEF Used in GetMaterialConstant to resolve a render constant’s value
Type: TYPEDEF Used in SetMaterialConstant to set a render constant’s value
Type: FUNCTION Create a new HComponentRenderConstants container
Returns
constants (dmGameSystem::HComponentRenderConstants)Type: FUNCTION Destroys a render constants container
Parameters
constants (dmGameSystem::HComponentRenderConstants) - (must not be 0)Type: FUNCTION set the constants of a render object
Parameters
ro (dmRender::RenderObject*) - the render objectconstants (dmGameSystem::HComponentRenderConstants) - the constantsType: FUNCTION Destroys a render constants container
Parameters
constants (dmGameSystem::HComponentRenderConstants) - the constantsname_hash (dmhash_t) - the hashed name of the propertyout_constant (dmRender::Constant**) - the pointer where to store the constantReturns
result (bool) - returns true if the constant existsType: FUNCTION Get a render constant by index
Parameters
constants (dmGameSystem::HComponentRenderConstants) - the constantsindex (uint32_t) - the indexReturns
constant (dmRender::HConstant) - the pointer where to store the constantType: FUNCTION Get the number of render constants
Parameters
constants (dmGameSystem::HComponentRenderConstants) - the constantsReturns
size (uint32_t) - returns the number of set constantsType: FUNCTION Hashes the constants
Notes
AreRenderConstantsUpdated will always return false.Parameters
constants (dmGameSystem::HComponentRenderConstants) - the constantsstate (HashState32*) - the hash state to updateType: TYPEDEF Found in hash.h
Type: TYPEDEF Render constants handle
Type: FUNCTION Set a render constant by name. The constant must exist in the material
Parameters
constants (dmGameSystem::HComponentRenderConstants) - the render constants buffermaterial (dmRender::HMaterial) - the material to get default values from if constant didn’t already exist in the render constants buffername_hash (dmhash_t) - the hashed name of the constantvalue_index (uint32_t) - index of the constant value to set, if the constant is an arrayelement_index (uint32_t*) - pointer to the index of the element (in range [0,3]). May be 0var (const dmGameObject::PropertyVar&) - the constant valueType: FUNCTION Set a render constant by name. The constant must exist in the material
Parameters
constants (dmGameSystem::HComponentRenderConstants) - the constantsname_hash (dmhash_t) - the hashed name of the constantvalues (dmVMath::Vector4*) - the valuesnum_values (uint32_t) - number of values in the array