vertex_end(buffer)

From ENIGMA

Jump to: navigation, search

Description

Finalizes the vertex data held by the given vertex buffer preparing it to be rendered with vertex_submit. After this function has been called, and before vertex_submit, it may be a good idea to call vertex_freeze, if you do not intend to specify the vertex data again, so that the vertex buffer can be marked with static instead of dynamic usage for the driver.

Parameters

Parameter Data Type Description
buffer integer Index of the vertex buffer.

Return Values

void: This function does not return anything.

Example Call

// create the vertex format used by our static triangle buffer
vertex_format_begin();
vertex_format_add_color();
vertex_format_add_position();
vf_color_position = vertex_format_end();

// create a static vertex buffer to hold our triangle vertices
var static_buffer;
static_buffer = vertex_create_buffer();

// demonstrates adding a triangle primitive to a vertex buffer
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);
Personal tools
Namespaces
Variants
Actions
Navigation
ENIGMA
Other
Toolbox