vertex_begin

Begin the definition of a custom primitive.

Syntax:

GML Code Example

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:

GML Code 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.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here