vertex_begin(buffer,format)

From ENIGMA

Jump to: navigation, search

Description

Declares the given vertex buffer to begin a new primitive with the given vertex format. This function should be called before passing any vertex data such as texture coordinates and normals, and vertex_end should be called when you are finished adding data to the primitive.

Parameters

Parameter Data Type Description
buffer integer Index of the vertex buffer to write to.
format integer Index of the vertex format.

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