Module glium::index
[−]
[src]
In order to draw, you need to provide a source of indices which is used to link the vertices together into primitives.
There are eleven types of primitives, each one with a corresponding struct:
PointsListLinesListLinesListAdjacencyLineStripLineStripAdjacencyTrianglesListTrianglesListAdjacencyTriangleStripTriangleStripAdjacencyTriangleFanPatches
These structs can be turned into an IndexBuffer, which uploads the data in video memory.
There are three ways to specify the indices that must be used:
- Passing a reference to one of these structs.
- Passing a reference to an
IndexBuffer. NoIndices, which is equivalent to(0, 1, 2, 3, 4, 5, 6, 7, ..).
For performances it is highly recommended to use either an IndexBuffer or NoIndices, and to
avoid passing indices in RAM.
When you draw something, a draw command is sent to the GPU and the execution continues immediatly after. But if you pass indices in RAM, the execution has to block until the GPU has finished drawing in order to make sure that the indices are not free'd.
Reexports
pub use self::buffer::{IndexBuffer}; |
Structs
| DrawCommandIndices | |
| DrawCommandNoIndices | |
| DrawCommandsIndicesBuffer |
A buffer containing a list of draw commands. |
| DrawCommandsNoIndicesBuffer |
A buffer containing a list of draw commands. |
| IndexBufferAny |
An |
| IndexBufferSlice |
Slice of an |
| NoIndices |
Marker that can be used as an indices source when you don't need indices. |
Enums
| BufferCreationError |
Error that can happen while creating an index buffer. |
| IndexType |
Type of the indices in an index source. |
| IndicesSource |
Describes a source of indices used for drawing. |
| PrimitiveType |
List of available primitives. |
Traits
| Index |
An index from the index buffer. |