Main | API | WebRender | draw

Function

draw(vbo, start, length);

This executes a draw of the provided vertex data (vbo).

Parameters

vbo - [Unsigned Integer]

The id for what vertex buffer that is being drawn.

start - [Unsigned Integer]

The index to start drawing from.

length - [Unsigned Integer]

The number of vertices that should be drawn.

Return

None.

Description

This function sends vertex data into the rendering pipeline, using the id of the vertex buffer to be drawn, the starting point within that buffer, and the number of vertices to be drawn. In order to preserve performance, there is very little error checking within the draw function and rendering pipeline, if something goes wrong while drawing you will most likely receive a crash and error in the console with no useful information.

Since WebRender only deals with triangles, if the length is not a multiple of three, then the remaining vertices will be ignored.

Additional Notes

If an error is detected, see the browser's console log for description, however it may not be useful. Make sure your vertex data, shaders and shader variables have been set up correctly.