vertex_submit

Freeze the given vertex buffer.

Syntax:

vertex_submit(buffer, primitive, texture);


ArgumentDescription
buffer The buffer to use.
primitive The primitive base type.
texture The texture to use (or -1 for no texture).


Returns: N/A


Description

You can use this function to submit the contents of a vertex buffer to the graphics pipeline for use with a shader. You supply the buffer index to use, the base primitive type to use (see the constants below) and the texture that is to be used. The base primitive type is only used for assigning the order in which the vertexes that you stored in the buffer are drawn and connected, but the actual data used for each of the vertexes will be that which you defined when creating the vertex buffer.

For a visual example of the different base primitives available, please see the function draw_primitive_begin

NOTE: this function can only be used in the Draw Event.

ConstantDescription
pr_pointlistA primitive consisting of a list of points.
pr_linelistA primitive made up of a individual lines in a list.
pr_linestripA primitive made up of a consecutive strip of lines.
pr_trianglelistA primitive made up of individual triangles in a list.
pr_triangle_stripA primitive made up of a consecutive strip of triangles.


Example:

shader_set(shader_prim);
vertex_submit(buff, pr_trianglelist, sprite_get_texture(sprite_index));
shader_reset();

The above code will submit the vertex buffer indexed in the variable "buff" for drawing with the shader "shader_prim", using a triangle list as the base primitive and the texture of the sprite for the instance running the code.


Back: Building Primitives
Next: vertex_create_buffer

© Copyright YoYo Games Ltd. 2018 All Rights Reserved