Struct glitter::vertex_buffer::AttribBinder [] [src]

pub struct AttribBinder { /* fields omitted */ }

A type used to perform operations on a list of program attributes. An instance of an AttribBinder can be created with the attrib_pointers! macro or with the new method.

Note

Currently, AttribBinder when both adding vertex attributes and when operating on vertex attributes. Consider using the direct lower-level glitter API's if heap allocations become a performance bottleneck.

Methods

impl AttribBinder
[src]

[src]

Create a new, empty AttribBinder.

[src]

Add an attribute to the AttribBinder.

Failures

add will return an error if the attribute being added is already present.

Note

Each call to add can potentially cause a heap allocation.

[src]

Enable all of the vertex attributes contained within the AttribBinder. The provided type of VertexData is used to to verify the list of attributes.

Failures

An error will be returned if the set of vertex attributes contained by the VertexData types does not exactly match the list of attributes contained by the AttribBinder.

Note

Currently, calling enable will perform a heap allocation. Consider using gl.enable_vertex_attrib_array if this becomes a performance concern.

[src]

Set up each vertex attribute with the appropriate attribute options (using glVertexAttribPointer). The VertexData type parameter is used to get the attribute options for each attribute.

Failures

An error will be returned if the set of vertex attributes contained by the VertexData types does not exactly match the list of attributes contained by the AttribBinder.

Note

Currently, calling bind will perform a heap allocation. Consider using gl.enable_vertex_attrib_array if this becomes a performance concern.