Skip to content

cf_draw3d_mesh_range

Category: draw3d
GitHub: cute_draw3d.h


Submits a contiguous element range of a mesh under the current 3d state.

void cf_draw3d_mesh_range(CF_Mesh mesh, int first_element, int element_count);
Parameters Description
mesh The mesh, from cf_make_mesh.
first_element The first index (indexed meshes) or first vertex (non-indexed) to draw.
element_count How many indices or vertices to draw.

Remarks

The geometry-arena companion to cf_draw3d_mesh: pack many small meshes into one CF_Mesh and submit each as a range. Because every submission shares the same mesh, interleaving different ranges no longer splits the batch -- range submissions under the same state coalesce into ONE command that binds everything once and issues one tight range draw per contiguous record, where the same interleaving as separate meshes would cost a full state rebind per submission. Consecutive submissions of the SAME range still collapse into a single instanced draw, exactly like cf_draw3d_mesh.

An indexed arena writes its indices absolute into the shared vertex buffer -- there is deliberately no base-vertex offset (it would not port to GLES3). Ranges do not compose with cf_draw3d_push_texture's sprite texturing. Ordering, translucency sorting, and the escape hatch behave exactly as documented on cf_draw3d_mesh.

cf_draw3d_mesh
CF_Mesh
cf_make_mesh
cf_draw_elements_range
cf_draw3d_stats