Component render constant API documentation

Version: alpha

FUNCTION
CreateRenderConstants() Create a new HComponentRenderConstants container
DestroyRenderConstants() Destroys a render constants container
GetRenderConstant() Destroys a render constants container
GetRenderConstantCount() Get the number of render constants
GetRenderConstant() Get a render constant by index
SetRenderConstant() Set a render constant by name. The constant must e...
ClearRenderConstant() Removes a render constant from the container
HashRenderConstants() Hashes the constants
AreRenderConstantsUpdated() check if the constants have changed
EnableRenderObjectConstants() set the constants of a render object

Functions

CreateRenderConstants()

CreateRenderConstants()

Create a new HComponentRenderConstants container

PARAMETERS

RETURNS

constants dmGameSystem::HComponentRenderConstants

DestroyRenderConstants()

DestroyRenderConstants(constants)

Destroys a render constants container

PARAMETERS

constants dmGameSystem::HComponentRenderConstants (must not be 0)

GetRenderConstant()

GetRenderConstant(constants,name_hash,out_constant)

Destroys a render constants container

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the constants
name_hash dmhash_t the hashed name of the property
out_constant dmRender::Constant** the pointer where to store the constant

RETURNS

result bool returns true if the constant exists

GetRenderConstantCount()

GetRenderConstantCount(constants)

Get the number of render constants

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the constants

RETURNS

size uint32_t returns the number of set constants

GetRenderConstant()

GetRenderConstant(constants,index,constant)

Get a render constant by index

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the constants
index uint32_t the index
constant dmRender::Constant* the pointer where to store the constant

SetRenderConstant()

SetRenderConstant(constants,material,name_hash,element_index,var)

Set a render constant by name. The constant must exist in the material

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the constants
material dmRender::HMaterial the material
name_hash dmhash_t the hashed name of the constant
element_index uint32_t*] pointer to the index of the element (in range [0,3 ). May be 0
var const dmGameObject::PropertyVar& the constant value

ClearRenderConstant()

ClearRenderConstant(constants,name_hash)

Removes a render constant from the container

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the constants
name_hash dmhash_t the hashed name of the constant

RETURNS

result int non zero if the constant was removed

HashRenderConstants()

HashRenderConstants(constants,state)

Hashes the constants

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the constants
state HashState32* the hash state to update

AreRenderConstantsUpdated()

AreRenderConstantsUpdated(constants)

check if the constants have changed

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the constants

RETURNS

result int non zero if the constants were changed

EnableRenderObjectConstants()

EnableRenderObjectConstants(ro,constants)

set the constants of a render object

PARAMETERS

ro dmRender::RenderObject* the render object
constants dmGameSystem::HComponentRenderConstants the constants