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.
vertex_create_buffer_from_buffer(buffer, format);
Argument | Type | Description |
---|---|---|
buffer | Buffer | The buffer to create the vertex buffer from. |
format | Vertex Format | The vertex format to use. |
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.