# Class: indexarray

meshes contain indices for rendering their primitives, with this interface you can modify them. Always make sure that the corresponding vertices exist and always run indexMinmax once you set all indices. If you use display lists or vbos, changes to a loaded model will not be visible.

## Hierarchy

    o-+ renderinterface
      o-+ indexarray

## Classes that implement this interface:

- framefxmesh
- l2dimage
- l3dprimitive
- meshid

## Methods:

### Method overview:

- indexAllocatedcount
- indexCopy
- indexCount
- indexMeshtype
- indexMinmax
- indexPrimitive
- indexPrimitivecount
- indexPrimitivetype
- indexTrianglecount
- indexUpdateVBO
- indexValue

indexAllocatedcount (indexarray)
  returns: ([int cnt])
  return indices count. This is the number of indices that can be used in this indexarray, index must always be smaller than this.
indexCopy (indexarray,int start,indexarray from,int fromstart, int size,[int vertexoffset])
  returns: ([int])
  copies indices from one indexarray into self, starting at given index and optionally offsetting the copied.
indexCount (indexarray,[int cnt])
  returns: ([int])
  set or return the number of indices to be used on rendering. This value must always be smaller than Allocatedcount.
indexMeshtype (indexarray)
  returns: ([string])
  returns what type of mesh the indices/vertices are stored in (unset,va,vbo)
indexMinmax (indexarray)
  returns: (int min,max)
  computes minimum and maximum index used within indexCount. This is required for an indexarray to work, call this after all indices are set.
indexPrimitive (indexarray,primindex,[int a,b,c...])
  returns: ([int a,b,c...])
  set or returns the primitive at given position. The function will return/need 1 index for points, 2 for lines, 3 indices for triangles, 4 indices for quads and can only return indices for any strips/loops/fan. Polygons are not supported, since the whole indexarray always contains only one.
indexPrimitivecount (indexarray)
  returns: ([int])
  returns the number of primitives based on indexCount
indexPrimitivetype (indexarray, [int])
  returns: ([int])
  set or return the primitive type. 0 points, 1 lines, 2 lineloop, 3 linestrip, 4 triangles, 5 trianglestrip, 6 trianglefan, 7 quads, 8 quadstrip, 9 polygon (must be convex)
indexTrianglecount (indexarray)
  returns: ([int])
  returns and updates the internal number of triangles based on current indexCount. This is only needed for statistics and should be called at least once after all indices were written.
indexUpdateVBO (indexarray)
  returns: (boolean)
  if possible resubmits array using indexAllocatedcount to VBO, returns true on success else false (no VBO or non compatible indexarray).
indexValue (indexarray,index,[int value])
  returns: ([int value])
  set or returns value at the given index. Make sure the corresponding vertex exists

## Inherited Methods: