Draw calls

These calls are beeing used to draw geometry. All drawcalls have the abillity to draw multiple objects at once. Each individual object will get its instance uniform block from either an array in user memory or a array pool. It is recomended to build up arrays of ojects and draw them in a single call rather them making many individual calls. Memory arrays are recomended for dynamic data created by the CPU, where as a array object is faster if the data is static or is generated by the GPU.

r_array_draw

void r_array_draw(void *pool, void *section, RPrimitive primitive_type, uint vertex_start, uint vertex_count, uint8 *uniforms, void *array_pool, uint count);

Description: Draws one or more identical objects reading vertex data from "pool", section is an optinal vertex or refference section from pool. Primitive_type is the primitive beeing drawn. Vertex start is the first vertex in the pool/section to be drawn. vertex_count is the maximum number of veritices drawn for each instance. If the number of vertices in the pool/section is less then vertex_count, then only the availabe veriteces will be drawn. Uniforms is a pointer to an array of uniform data. The data needs to be the size of the instance block (that can be obtained by calling r_shader_uniform_block_size) times the number of instances. array_pool is an alternative way of feeding the draw call with unifom data using a array pool. count is the numer of instances beeing drawn.

Types:

Enum:

RPrimitive

R_PRIMITIVE_POINTS

=

0x0000

Description: Draw point primitives.

R_PRIMITIVE_LINES

=

0x0001

Description: Draw Line primitives.

R_PRIMITIVE_TRIANGLES

=

0x0004

Description: Draw Triangle primitives

r_array_sections_draw

void r_array_sections_draw(void *pool, void **section, RPrimitive primitive_type, uint8 *uniforms, void *array_pool, uint count);

Description: Draws multiple objects reading vertex data from "pool". Section is an array of pointers to sections allocated from the pool. All sectons can only contain vertex data. Primitive_type is the primitive beeing drawn. Uniforms is a pointer to an array of uniform data. The data needs to be the size of the instance block (that can be obtained by calling r_shader_uniform_block_size) times the number of instances. Array_pool is an alternative way of feeding the draw call with unifom data using a array pool. Count is the number of objects being drawn.

Types:

Enum:

RPrimitive

R_PRIMITIVE_POINTS

=

0x0000

Description: Draw point primitives.

R_PRIMITIVE_LINES

=

0x0001

Description: Draw Line primitives.

R_PRIMITIVE_TRIANGLES

=

0x0004

Description: Draw Triangle primitives

r_array_references_draw

void r_array_references_draw(void *pool, void **section, RPrimitive primitive_type, void *uniforms, void *array_pool, uint count);

Description: Draws multiple objects reading vertex data from "pool". Section is an array of pointers to sections allocated from the pool. All sectons can only contain reference data. Primitive_type is the primitive beeing drawn. Uniforms is a pointer to an array of uniform data. The data needs to be the size of the instance block (that can be obtained by calling r_shader_uniform_block_size) times the number of instances. Array_pool is an alternative way of feeding the draw call with unifom data using a array pool. Count is the number of objects being drawn.

Types:

Enum:

RPrimitive

R_PRIMITIVE_POINTS

=

0x0000

Description: Draw point primitives.

R_PRIMITIVE_LINES

=

0x0001

Description: Draw Line primitives.

R_PRIMITIVE_TRIANGLES

=

0x0004

Description: Draw Triangle primitives

r_array_vertex_render

void r_array_vertex_render(void *in_pool, void *out_pool);

Description: Renders a vertex pool to another ppol. All vertices gets processed by the currently bound shaders. The output vertex array pools format needs toi match the format of the outupt of the vertex/geopmetry shaders.

r_array_section_draw

void r_array_section_draw(void *pool, void *section, RPrimitive primitive_type, uint vertex_start, uint vertex_count);

Description: deprecated drawcall replaced by r_array_draw.

Types:

Enum:

RPrimitive

R_PRIMITIVE_POINTS

=

0x0000

Description: Draw point primitives.

R_PRIMITIVE_LINES

=

0x0001

Description: Draw Line primitives.

R_PRIMITIVE_TRIANGLES

=

0x0004

Description: Draw Triangle primitives

r_array_reference_draw

void r_array_reference_draw(void *pool, void *section, RPrimitive primitive_type, uint vertex_start, uint vertex_count);

Description: deprecated drawcall replaced by r_array_draw.

Types:

Enum:

RPrimitive

R_PRIMITIVE_POINTS

=

0x0000

Description: Draw point primitives.

R_PRIMITIVE_LINES

=

0x0001

Description: Draw Line primitives.

R_PRIMITIVE_TRIANGLES

=

0x0004

Description: Draw Triangle primitives