Vertex_get_number - hpgDesigns/hpgdesigns-dev.io GitHub Wiki
Description
Gets the number of vertices specified in the given vertex buffer.
Parameters
Parameter | Data Type | Description |
---|---|---|
buffer | integer | Index of the vertex buffer. |
Return Values
unsigned: Returns the number of vertices specified in the given vertex buffer.
Example Call
// add a triangle to a vertex buffer we want to be static
vertex_begin(static_buffer, vf_color_position);
vertex_color(static_buffer, c_red, 1);
vertex_position(static_buffer, 100, room_height - 100);
vertex_color(static_buffer, c_green, 1);
vertex_position(static_buffer, room_width / 2, 100);
vertex_color(static_buffer, c_blue, 1);
vertex_position(static_buffer, room_width - 100, 100);
vertex_end(static_buffer);
// demonstrates querying for the number of vertices in a vertex buffer after it has been filled
var vertex_count;
vertex_count = vertex_get_number(static_buffer);
NOTOC