Vertex_get_buffer_size - hpgDesigns/hpgdesigns-dev.io GitHub Wiki
Description
Gets the size, in bytes, of the given vertex buffer and returns it.
Parameters
Parameter | Data Type | Description |
---|---|---|
buffer | integer | Index of the vertex buffer. |
Return Values
unsigned: Returns the size of the vertex buffer in number of bytes.
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 byte size of the entire vertex buffer after it has been filled
var byte_size;
byte_size = vertex_get_buffer_size(static_buffer);
NOTOC