Built-in scripting functions.
Namespace: | dmGameSystem |
Include: | #include <dmsdk/gamesys/gui.h> |
TYPES | |
---|---|
CompGetConstantCallback | Used in GetMaterialConstant to resolve a render co... |
CompSetConstantCallback | Used in SetMaterialConstant to set a render consta... |
HComponentRenderConstants | Render constants handle |
int AreRenderConstantsUpdated(dmGameSystem::HComponentRenderConstants constants)
check if the constants have changed
PARAMETERS
dmGameSystem::HComponentRenderConstants |
constants |
the constants |
RETURNS
int |
non zero if the constants were changed |
int ClearRenderConstant(dmGameSystem::HComponentRenderConstants constants, dmhash_t name_hash)
Removes a render constant from the container
PARAMETERS
dmGameSystem::HComponentRenderConstants |
constants |
the constants |
dmhash_t |
name_hash |
the hashed name of the constant |
RETURNS
int |
non zero if the constant was removed |
dmGameSystem::HComponentRenderConstants CreateRenderConstants()
Create a new HComponentRenderConstants container
PARAMETERS
RETURNS
dmGameSystem::HComponentRenderConstants |
void DestroyRenderConstants(dmGameSystem::HComponentRenderConstants constants)
Destroys a render constants container
PARAMETERS
dmGameSystem::HComponentRenderConstants |
constants |
(must not be 0) |
void DM_DECLARE_COMPGUI_TYPE(C++ symbol name symbol, const char* name, GuiNodeTypeCreateFunction type_create_fn, GuiNodeTypeDestroyFunction type_destroy_fn)
Registers a new gui node type to the Gui component
PARAMETERS
C++ symbol name |
symbol |
The unique C++ symbol name |
const char* |
name |
The name of the node type |
GuiNodeTypeCreateFunction |
type_create_fn |
the create function |
GuiNodeTypeDestroyFunction |
type_destroy_fn |
the destroy function. May be 0 |
void EnableRenderObjectConstants(dmRender::RenderObject* ro, dmGameSystem::HComponentRenderConstants constants)
set the constants of a render object
PARAMETERS
dmRender::RenderObject* |
ro |
the render object |
dmGameSystem::HComponentRenderConstants |
constants |
the constants |
bool GetRenderConstant(dmGameSystem::HComponentRenderConstants constants, dmhash_t name_hash, dmRender::Constant** out_constant)
Destroys a render constants container
PARAMETERS
dmGameSystem::HComponentRenderConstants |
constants |
the constants |
dmhash_t |
name_hash |
the hashed name of the property |
dmRender::Constant** |
out_constant |
the pointer where to store the constant |
RETURNS
bool |
returns true if the constant exists |
dmRender::HConstant GetRenderConstant(dmGameSystem::HComponentRenderConstants constants, uint32_t index)
Get a render constant by index
PARAMETERS
dmGameSystem::HComponentRenderConstants |
constants |
the constants |
uint32_t |
index |
the index |
RETURNS
dmRender::HConstant |
the pointer where to store the constant |
uint32_t GetRenderConstantCount(dmGameSystem::HComponentRenderConstants constants)
Get the number of render constants
PARAMETERS
dmGameSystem::HComponentRenderConstants |
constants |
the constants |
RETURNS
uint32_t |
returns the number of set constants |
void GuiNodeTypeDestroyFunction()
PARAMETERS
void GuiNodeTypeDestroyFunction()
PARAMETERS
void HashRenderConstants(dmGameSystem::HComponentRenderConstants constants, HashState32* state)
Hashes the constants
PARAMETERS
dmGameSystem::HComponentRenderConstants |
constants |
the constants |
HashState32* |
state |
the hash state to update |
void SetRenderConstant(dmGameSystem::HComponentRenderConstants constants, dmRender::HMaterial material, dmhash_t name_hash, uint32_t value_index, uint32_t* element_index, const dmGameObject::PropertyVar& var)
Set a render constant by name. The constant must exist in the material
PARAMETERS
dmGameSystem::HComponentRenderConstants |
constants |
the render constants buffer |
dmRender::HMaterial |
material |
the material to get default values from if constant didn't already exist in the render constants buffer |
dmhash_t |
name_hash |
the hashed name of the constant |
uint32_t |
value_index |
index of the constant value to set, if the constant is an array |
uint32_t* |
element_index |
pointer to the index of the element (in range [0,3]). May be 0 |
const dmGameObject::PropertyVar& |
var |
the constant value |
void SetRenderConstant(dmGameSystem::HComponentRenderConstants constants, dmhash_t name_hash, dmVMath::Vector4* values, uint32_t num_values)
Set a render constant by name. The constant must exist in the material
PARAMETERS
dmGameSystem::HComponentRenderConstants |
constants |
the constants |
dmhash_t |
name_hash |
the hashed name of the constant |
dmVMath::Vector4* |
values |
the values |
uint32_t |
num_values |
number of values in the array |
Used in GetMaterialConstant to resolve a render constant's value
Used in SetMaterialConstant to set a render constant's value
Render constants handle