This function starts the definition of a custom primitive.
You assign a vertex buffer to write the primitive to, and the vertex format to use (previously defined using the vertex format functions). You would then define the necessary points for each vertex of the primitive before calling vertex_end to finalise the primitive creation.
vertex_begin(buffer, format);
Argument | Type | Description |
---|---|---|
buffer | Vertex Buffer | The vertex buffer to be written to. |
format | Vertex Format | The vertex format to use. |
N/A
vertex_format_begin();
vertex_format_add_position();
vertex_format_add_colour();
vertex_format_add_texcoord();
v_format = vertex_format_end();
v_buff = vertex_create_buffer();
vertex_begin(v_buff, v_format);
The above code defines a new vertex format, creates a new buffer and start the definition process of a new primitive.