Component Render Constants

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

API

AreRenderConstantsUpdated

Type: FUNCTION check if the constants have changed

Parameters

Returns

ClearRenderConstant

Type: FUNCTION Removes a render constant from the container

Parameters

Returns

CompGetConstantCallback

Type: TYPEDEF Used in GetMaterialConstant to resolve a render constant’s value

CompSetConstantCallback

Type: TYPEDEF Used in SetMaterialConstant to set a render constant’s value

CreateRenderConstants

Type: FUNCTION Create a new HComponentRenderConstants container

Returns

DestroyRenderConstants

Type: FUNCTION Destroys a render constants container

Parameters

EnableRenderObjectConstants

Type: FUNCTION set the constants of a render object

Parameters

GetMaterialConstant

Type: FUNCTION Helper function to get material constants of components that use them: sprite, label, tile maps, spine and models Sprite and Label should not use value ptr. Deleting a gameobject (that included sprite(s) or label(s)) will rearrange the object pool for components (due to EraseSwap in the Free for the object pool). This result in the original animation value pointer will still point to the original memory location in the component object pool.

Parameters

Returns

GetRenderConstant

Type: FUNCTION Destroys a render constants container

Parameters

Returns

GetRenderConstant

Type: FUNCTION Get a render constant by index

Parameters

Returns

GetRenderConstantCount

Type: FUNCTION Get the number of render constants

Parameters

Returns

HashRenderConstants

Type: FUNCTION Hashes the constants

Notes

Parameters

HashState32

Type: TYPEDEF Found in hash.h

HComponentRenderConstants

Type: TYPEDEF Render constants handle

SetMaterialConstant

Type: FUNCTION Helper function to set material constants of components that use them: sprite, label, tile maps, spine and models

Parameters

Returns

SetRenderConstant

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

Parameters

SetRenderConstant

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

Parameters