vertex_create_buffer_from_buffer

This function creates a new vertex buffer by copying the data from the specified source buffer.

The data in the source buffer must be pre-formatted according to the vertex format for building primitives for use with (for example) shaders.

 

Syntax:

vertex_create_buffer_from_buffer(buffer, format);

ArgumentTypeDescription
bufferBufferThe buffer to create the vertex buffer from.
formatVertex FormatThe vertex format to use.

 

Returns:

Vertex Buffer

 

Example:

vertex_format_begin();
vertex_format_add_position_3d();
vertex_format_add_colour();
vertex_format_add_texcoord();
var _my_format = vertex_format_end();
v_buff = vertex_create_buffer_from_buffer(global.modelBuff, _my_format);

The above code first creates a new vertex format and then creates a new vertex buffer from a previously created regular buffer, applying the custom vertex format to it.