vertex_begin

Begin the definition of a custom primitive.

Syntax:

vertex_begin(buffer, format);


Argument Description
buffer The buffer to be written to.
format The vertex format to use.


Returns: N/A


Description

With this function you begin the definition of a custom primitive. You assign a 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.


Example:

vertex_format_begin();
vertex_format_add_position();
vertex_format_add_colour();
vertex_format_add_textcoord();
v_format = vertex_format_end();
v_buff = vertex_create_buffer();
vertex_begin(v_buff, v_format);

The above code will define a new vertex format, create a new buffer and start the definition process of a new primitive.


Back: Building Primitives
Next: vertex_get_number
© Copyright YoYo Games Ltd. 2018 All Rights Reserved