vertex_format_get_info

This function returns a struct with information on a previously created vertex format.

 

Vertex Format Info Struct
VariableTypeDescription
strideRealThe total size in bytes of a single vertex
num_elementsRealThe number of elements (vertex attributes) in a single vertex
elementsArrayAn array of elements. Each array element is a struct containing the following: 
- usage (Vertex Usage Type Constant)
- type (Vertex Data Type Constant)
- size (Real)
- offset (Real)

 

Syntax:

vertex_format_get_info(format);

ArgumentTypeDescription
formatVertex FormatThe vertex format, as returned by vertex_format_end

 

Returns:

Vertex Format Info Struct

 

Example:

vertex_format_begin();
vertex_format_add_position_3d();
vertex_format_add_normal();
vertex_format_add_colour();
vertex_format_add_texcoord();
vertex_format_add_custom(vertex_type_float1, vertex_usage_texcoord);
vertex_format = vertex_format_end();

var _info = vertex_format_get_info(vertex_format);
show_debug_message(json_stringify(_info, true));

The above code first creates a custom vertex format and then gets the info using vertex_format_get_info. After that, the info is shown in a debug message.