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...
dmRender::RenderObject::MAX_CONSTANT_COUNT() The maximum number of shader constants the render ...
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
ENUMS
Result
RenderListOperation Render batch callback states
RenderOrder Render order

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


dmRender::RenderObject::MAX_CONSTANT_COUNT()

dmRender::RenderObject::MAX_CONSTANT_COUNT()

The maximum number of shader constants the render object can hold (currently 16)

PARAMETERS


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,fn,user_data)

Register a render dispatch function

PARAMETERS

context dmRender::HRenderContext the context
fn dmRender::RenderListDispatchFn the render batch callback function
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