VertexArrayIndexes - Rabbyt Reference

Documentation Index | From module rabbyt.vertexarrays.

# VertexArrayIndexes

`VertexArrayIndexes([sequence])`

Provides a way to list by indexes the vertexes to be rendered.

This is useful if you have multiple primitives sharing a vertex, and you want to either save memory or make it easier to modify the data.

## Methods

### append

`append(index)`

Appends an index to be drawn.

### extend

### render

`render(vertex_array, [start, end, enable_arrays, safety_check])`

This renders the vertexes in `vertex_array`, which should be an instance of `VertexArray`.

`start` and `end` define which vertexes to render, and default to rendering all of them.

If `enable_arrays` is `True`, (the default,) `vertex_array.enable_arrays()` will be called automatically, along with pushing and popping the client state. If you are rendering many `VertexArrayIndexes` off of the same `VertexArray`, you might see a small speedup by only calling `enable_arrays()` on the `VertexArray` once.

If `safety_check` is `True`, (the default,) the `safety_check()` method will be called with the length of the `VertexArray`. This prevents segmentation faults, but adds a little overhead. You can set this to `False` once your code is debugged. (Just remember to look if you ever get a segfault!)

### safety_check

`safety_check(max_index)`

Loops through all of the indexes and raises `ValueError` if one is greater than or equal to `max_index`.

## Properties

### mode

If non zero, this mode will override the `VertexArray`'s mode when render is called.