Skip to content

Vertex_clear

hugh greene edited this page Jun 20, 2022 · 1 revision

Description

Clears the client-side data in the given vertex buffer and marks it dirty as well as no longer frozen. This means the backend will upload new vertex data the next time the vertex buffer is submitted for rendering. After this function is called, and before the vertex buffer is submitted, new vertex data can be supplied that will replace the old vertex data.

Parameters

Parameter Data Type Description
buffer integer Index of the vertex buffer.

Return Values

void: This function does not return anything.

Example Call

// demonstrates clearing a static vertex buffer so that it's vertex data can be specified again
vertex_clear(static_buffer);

// add a triangle to a vertex buffer we want to be static
vertex_begin(static_buffer, vf_color_position);
vertex_color(static_buffer, c_red, 1);
vertex_position(static_buffer, 100, room_height - 100);
vertex_color(static_buffer, c_green, 1);
vertex_position(static_buffer, room_width / 2, 100);
vertex_color(static_buffer, c_blue, 1);
vertex_position(static_buffer, room_width - 100, 100);
vertex_end(static_buffer);

NOTOC

Clone this wiki locally