Render API documentation

Version: alpha

FUNCTION
dmRender::GetMaterialVertexSpace() Get the vertex space (local or world)
dmRender::RenderObject::MAX_TEXTURE_COUNT() The maximum number of textures the render object c...
RenderListEntry() Represents a renderable object (e.g. a single spri...
RenderListMakeDispatch() Register a render dispatch function
RenderListAlloc() Allocates an array of render entries
RenderListSubmit() Adds a render object to the current render frame
AddToRender() Adds a render object to the current render frame
GetMaterialTagListKey() Gets the key to the material tag list
NewConstant() Creates a shader program constant
DeleteConstant() Deletes a shader program constant
GetConstantValues() Gets the shader program constant values
SetConstantValues() Sets the shader program constant values
GetConstantName() Gets the shader program constant name
GetConstantName() Gets the shader program constant name
GetConstantLocation() Gets the shader program constant location
SetConstantLocation() Sets the shader program constant location
GetConstantType() Gets the type of the constant
SetConstantType() Sets the type of the constant
NewNamedConstantBuffer() Allocates a named constant buffer
DeleteNamedConstantBuffer() Deletes a named constant buffer
ClearNamedConstantBuffer() Clears a named constant buffer from any constants.
RemoveNamedConstant() Removes a named constant from the buffer
SetNamedConstant() Sets a named constant to the buffer
SetNamedConstants() Sets a list of named constants to the buffer
GetNamedConstant() Gets a named constant from the buffer
GetNamedConstantCount() Gets number of constants in the buffer
ENUMS
Result
RenderListOperation Render batch callback states
RenderOrder Render order
Visibility Visibility status

Functions

dmRender::GetMaterialVertexSpace()

dmRender::GetMaterialVertexSpace(material)

Get the vertex space (local or world)

PARAMETERS

material dmRender::HMaterial the material

RETURNS

vertex_space dmRenderDDF::MaterialDesc::VertexSpace the vertex space

dmRender::RenderObject::MAX_TEXTURE_COUNT()

dmRender::RenderObject::MAX_TEXTURE_COUNT()

The maximum number of textures the render object can hold (currently 8)

PARAMETERS

None


RenderListEntry()

RenderListEntry(m_WorldPosition,m_Order,m_BatchKey,m_TagListKey,m_UserData,m_MinorOrder,m_MajorOrder,m_Dispatch)

Represents a renderable object (e.g. a single sprite) The renderer will (each frame) collect all entries with the current material tag, then batch these objects together. Batching is done based on the batch key and Z value (or order for GUI nodes) The caller will also register a callback function where the batched entries will be returned. Each callback then represents a draw call, and will register a RenderObject

PARAMETERS

m_WorldPosition dmVMath::Point3 the world position of the object
m_Order uint32_t the order to sort on (used if m_MajorOrder != RENDER_ORDER_WORLD)
m_BatchKey uint32_t the batch key to sort on (note: only 48 bits are currently used by renderer)
m_TagListKey uint32_t the key to the list of material tags
m_UserData uint64_t user data (available in the render dispatch callback)
m_MinorOrder uint32_t:4 used to sort within a batch
m_MajorOrder uint32_t:2 If RENDER_ORDER_WORLD, then sorting is done based on the world position. Otherwise the sorting uses the m_Order value directly.
m_Dispatch uint32_t:8 The dispatch function callback (dmRender::HRenderListDispatch)

RenderListMakeDispatch()

RenderListMakeDispatch(context,dispatch_fn,visibility_fn,user_data)

Register a render dispatch function

PARAMETERS

context dmRender::HRenderContext the context
dispatch_fn dmRender::RenderListDispatchFn the render batch callback function
visibility_fn dmRender::RenderListVisibilityFn the render list visibility callback function. May be 0
user_data void* userdata to the callback

RETURNS

dispatch dmRender::HRenderListDispatch the render dispatch function handle

RenderListAlloc()

RenderListAlloc(context,entries)

Allocates an array of render entries

PARAMETERS

context dmRender::HRenderContext the context
entries uint32_t the number of entries to allocate

RETURNS

array dmRender::RenderListEntry* the render list entry array

RenderListSubmit()

RenderListSubmit(context,begin,end)

Adds a render object to the current render frame

PARAMETERS

context dmRender::HRenderContext the context
begin dmRender::RenderListEntry* the start of the array
end dmRender::RenderListEntry* the end of the array (i.e. "while begin!=end: *begin ..."")

AddToRender()

AddToRender(context,ro)

Adds a render object to the current render frame

PARAMETERS

context dmRender::HRenderContext the context
ro dmRender::RenderObject* the render object

RETURNS

result dmRender::Result the result

GetMaterialTagListKey()

GetMaterialTagListKey(material)

Gets the key to the material tag list

PARAMETERS

material dmGraphics::HMaterial the material

RETURNS

listkey uint32_t the list key

NewConstant()

NewConstant(name_hash)

Creates a shader program constant

PARAMETERS

name_hash dmhash_t the name of the material constant

RETURNS

constant dmRender::HConstant the constant

DeleteConstant()

DeleteConstant(constant)

Deletes a shader program constant

PARAMETERS

constant dmRender::HConstant The shader constant

GetConstantValues()

GetConstantValues(constant,num_values)

Gets the shader program constant values

PARAMETERS

constant dmRender::HConstant The shader constant
num_values uint32_t* (out) the array num_values

RETURNS

values dmVMath::Vector4* the uniform values

SetConstantValues()

SetConstantValues(constant,values,num_values)

Sets the shader program constant values

PARAMETERS

constant dmRender::HConstant The shader constant
values dmVMath::Vector4* the array values
num_values uint32_t the array size (number of Vector4's)

RETURNS

result dmRender::Result the result

GetConstantName()

GetConstantName(constant)

Gets the shader program constant name

PARAMETERS

constant dmRender::HConstant The shader constant

RETURNS

name dmhash_t the hash name

GetConstantName()

GetConstantName(constant,name)

Gets the shader program constant name

PARAMETERS

constant dmRender::HConstant The shader constant
name dmhash_t the hash name

GetConstantLocation()

GetConstantLocation(constant)

Gets the shader program constant location

PARAMETERS

constant dmRender::HConstant The shader constant

RETURNS

location int32_t the location

SetConstantLocation()

SetConstantLocation(constant,location)

Sets the shader program constant location

PARAMETERS

constant dmRender::HConstant The shader constant
location int32_t the location

GetConstantType()

GetConstantType(constant)

Gets the type of the constant

PARAMETERS

constant dmRender::HConstant The shader constant

RETURNS

type dmRenderDDF::MaterialDesc::ConstantType the type of the constant

SetConstantType()

SetConstantType(constant,type)

Sets the type of the constant

PARAMETERS

constant dmRender::HConstant The shader constant
type dmRenderDDF::MaterialDesc::ConstantType the type of the constant

NewNamedConstantBuffer()

NewNamedConstantBuffer()

Allocates a named constant buffer

PARAMETERS

None

RETURNS

buffer dmRender::HNamedConstantBuffer the constants buffer

DeleteNamedConstantBuffer()

DeleteNamedConstantBuffer(buffer)

Deletes a named constant buffer

PARAMETERS

buffer dmRender::HNamedConstantBuffer the constants buffer

ClearNamedConstantBuffer()

ClearNamedConstantBuffer(buffer)

Clears a named constant buffer from any constants.

PARAMETERS

buffer dmRender::HNamedConstantBuffer the constants buffer

RemoveNamedConstant()

RemoveNamedConstant(buffer,name_hash)

Removes a named constant from the buffer

PARAMETERS

buffer dmRender::HNamedConstantBuffer the constants buffer
name_hash dmhash_t the name of the constant

SetNamedConstant()

SetNamedConstant(buffer,name_hash,values,num_values)

Sets a named constant to the buffer

PARAMETERS

buffer dmRender::HNamedConstantBuffer the constants buffer
name_hash dmhash_t the name of the constant
values dmVMath::Vector4* the values
num_values uint32_t the number of values

SetNamedConstants()

SetNamedConstants(buffer,constants,num_constants)

Sets a list of named constants to the buffer

PARAMETERS

buffer dmRender::HNamedConstantBuffer the constants buffer
constants dmRender::HConstant* the constants
num_constants uint32_t the number of constants

GetNamedConstant()

GetNamedConstant(buffer,name_hash,values,num_values)

Gets a named constant from the buffer

PARAMETERS

buffer dmRender::HNamedConstantBuffer the constants buffer
name_hash dmhash_t the name of the constant
values dmVMath::Vector4** (out) the values. May not be null.
num_values uint32_t* (out) the number of values. May not be null.

RETURNS

ok bool true if constant existed.

GetNamedConstantCount()

GetNamedConstantCount(buffer)

Gets number of constants in the buffer

PARAMETERS

buffer dmRender::HNamedConstantBuffer the constants buffer

RETURNS

ok bool true if constant existed.