vertex_submit

Freeze the given vertex buffer.

语法:

vertex_submit(buffer, primitive, texture);


参数 描述
buffer The buffer to use.
primitive The primitive base type.
texture The texture to use (or -1 for no texture).


返回: N/A(无返回值)


描述

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.

注意: This function can only be used in the Draw Event.


For a visual example of the different base primitives available, see the image below: Primitive Types

常量 描述
pr_pointlist A primitive consisting of a list of points.
pr_linelist A primitive made up of a individual lines in a list.
pr_linestrip A primitive made up of a consecutive strip of lines.
pr_trianglelist A primitive made up of individual triangles in a list.
pr_triangle_strip A primitive made up of a consecutive strip of triangles.


例如:

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.


上一页: Building Primitives
下一页: vertex_create_buffer
© Copyright YoYo Games Ltd. 2018 All Rights Reserved