Component render constant API documentation

Version: stable

FUNCTION
GuiNodeTypeDestroyFunction()
GuiNodeTypeDestroyFunction()
DM_DECLARE_COMPGUI_TYPE() Registers a new gui node type to the Gui component
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...
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

GuiNodeTypeDestroyFunction()

GuiNodeTypeDestroyFunction()

PARAMETERS

None


GuiNodeTypeDestroyFunction()

GuiNodeTypeDestroyFunction()

PARAMETERS

None


DM_DECLARE_COMPGUI_TYPE()

DM_DECLARE_COMPGUI_TYPE(symbol,name,type_create_fn,type_destroy_fn)

Registers a new gui node type to the Gui component

PARAMETERS

symbol C++ symbol name The unique C++ symbol name
name const char* The name of the node type
type_create_fn GuiNodeTypeCreateFunction the create function
type_destroy_fn GuiNodeTypeDestroyFunction the destroy function. May be 0

CreateRenderConstants()

CreateRenderConstants()

Create a new HComponentRenderConstants container

PARAMETERS

None

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)

Get a render constant by index

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the constants
index uint32_t the index

RETURNS

constant dmRender::HConstant the pointer where to store the constant

SetRenderConstant()

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

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

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the render constants buffer
material dmRender::HMaterial the material to get default values from if constant didn't already exist in the render constants buffer
name_hash dmhash_t the hashed name of the constant
value_index uint32_t index of the constant value to set, if the constant is an array
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

SetRenderConstant()

SetRenderConstant(constants,name_hash,values,num_values)

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

PARAMETERS

constants dmGameSystem::HComponentRenderConstants the constants
name_hash dmhash_t the hashed name of the constant
values dmVMath::Vector4* the values
num_values uint32_t number of values in the array

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