vertex_submit(buffer,primitive,texture)

From ENIGMA

Jump to: navigation, search

Overloads

vertex_submit(buffer,primitive)
vertex_submit(buffer,primitive,start,count)
vertex_submit(buffer,primitive,texture)
vertex_submit(buffer,primitive,texture,start,count)

Description

Submits the vertex data of the given vertex buffer to the graphics pipeline where it will be passed through any shaders in use on the GPU. This is analogous to "drawing" the vertex buffer contents and can be compared to d3d_model_draw which has more overhead, less customization, and is also passed through any shaders. The overloads which accept a start and count do not affect which vertices are uploaded to the GPU. These parameters accept any range so long as that range is within the bounds of the last primitive specified between vertex_begin and vertex_end.

Parameters

Parameter Data Type Description
buffer integer Index of the vertex buffer.
primitive integer Primitive type
start unsigned Index of the first vertex to draw.
count unsigned Number of vertices to draw.
texture integer Index of the texture to apply. Can be -1 for GameMaker compatibility or you can call an overload which does not accept the parameter.

Return Values

void: This function does not return anything.

Example Call

// demonstrates submitting a vertex buffer to the graphics pipeline
vertex_submit(static_buffer, pr_trianglelist);

// demonstrates submitting a vertex buffer to draw 3 vertices starting at index 0
vertex_submit(static_buffer, pr_trianglelist, 0, 3);

// demonstrates submitting a vertex buffer to draw with the texture of sprite "spr_player"
vertex_submit(static_buffer, pr_trianglelist, sprite_get_texture(spr_player));
Personal tools
Namespaces
Variants
Actions
Navigation
ENIGMA
Other
Toolbox