vertex_create_buffer

Create a new vertex buffer.

Syntax:

vertex_create_buffer();


Returns: Pointer


Description

With this function you can create a new vertex buffer. This is a special grow buffer created by GameMaker: Studio which is pre-formatted for use when building primitives (for use with shaders, for example). The function will return a "Pointer" (index) for the buffer which should then be used in all further calls to it.

When using a vertex buffer created with this function you simply call vertex_begin to start assigning vertex data to it to start to define your custom primitive, which will then be held in the buffer ready for submission to the shader. The buffer can be re-used when necessary (unless you have used the vertex_freeze function), with each call of vertex_begin wiping the previous buffer data ready to accept the new data.


Example:

v_buff = vertex_create_buffer();

The above code will create a new a new vertex buffer and store its handle in the variable "v_buff".


Back: Primitive Building
Next: vertex_create_buffer_ext
© Copyright YoYo Games Ltd. 2018 All Rights Reserved