Array data

This structure describes a single pointer

r_array_vertex_size

uint r_array_vertex_size(RFormats *vertex_format_types, uint *vertex_format_size, uint vertex_format_count);

Description: computes size in bytes of a specific vertext format.

Types:

Enum:

RFormats

R_INT8

R_UINT8

R_INT16

R_UINT16

R_INT32

R_UINT32

R_FLOAT

R_DOUBLE

r_array_allocate

void *r_array_allocate(uint vertex_count, RFormats *vertex_format_types, uint *vertex_format_size, uint vertex_format_count, uint reference_count);

Description: Allocates a pool of vertex_count number of vertices

Types:

Enum:

RFormats

R_INT8

R_UINT8

R_INT16

R_UINT16

R_INT32

R_UINT32

R_FLOAT

R_DOUBLE

r_array_allocate_from_shader

void *r_array_allocate_from_shader(RShader *s, uint vertex_count, uint reference_count, boolean in);

r_array_free

void r_array_free(void *pool);

Description: Frees a vertex array pool.

r_array_defrag

boolean r_array_defrag(void *pool);

Description: Moves one section of vertex data in a pool in order to defragmentate it. The funtion returns TRUE if a section was moved, and FALSE if there are no gaps in the vertex array left to collaps. In order to refragmet a pool entierly, simply call: while(r_array_defrag(pool));

r_array_section_allocate_vertex

void *r_array_section_allocate_vertex(void *pool, uint size);

Description: Allocates a section from pool consisting of size number of vertices. Will return a handle to the section or NULL if the pool does not have enough space to left.

r_array_section_allocate_reference

void *r_array_section_allocate_reference(void *pool, uint size);

Description: Allocates a section from pool consisting of size number of 32bit reference values. Will return a handle to the section or NULL if the pool does not have enough space to left.

r_array_section_free

void r_array_section_free(void *pool, void *section);

Description: REturn the memory used by a section to the pool and free the handle.

r_array_load_vertex

void r_array_load_vertex(void *pool, void *section, void *data, uint start, uint length);

Description: loads interleaved vertex data in to a pool or section of a pool. If section is NULL vertex data will be loaded directly in to the pool. Start and count indicate the where the data is inserted and how long the data is. Both are counted in number of veritices.

r_array_load_reference

void r_array_load_reference(void *pool, void *section, void *referencing_section, uint *data, uint length);

Description: loads an array of 32 bit uint data in to a section of a pool. Start and count indicate the where the data is inserted and how long the data is. Both are counted in number of vertex refferences.

r_array_get_size

uint r_array_get_size(void *pool);

Description: Returns the size in vertices of a pool

r_array_get_used

uint r_array_get_used(void *pool);

Description: Returns the number of vertices that have been allocated in to sections of a pool

r_array_get_left

uint r_array_get_left(void *pool);

Description: Returns the number of vertices that have not yet been allocated in to sections of a pool

r_array_get_vertex_size

uint r_array_get_vertex_size(void *pool);

Description: Returns the size in vertices of a pool.

r_array_section_get_vertex_count

uint r_array_section_get_vertex_count(void *section);

Description: returns the number of vertices of storage in a section.

r_array_debug_print_out

void r_array_debug_print_out(void *pool);

Description: Prints out the vertex format of a pool of standard out. (For debug purpouses)