Interface ILspVertexArray

All Known Subinterfaces:
ILspIndexedVertexArray, ILspMutableVertexArray, ILspNonIndexedVertexArray

public interface ILspVertexArray
Interface describing a vertex array. A vertex array consists of one or more Buffers with vertex data, as well as a number of ILspVertexAttribute objects describing the structure of the buffers.

Vertex arrays are usually modified asynchronously and rendered synchronously, hence locking is needed.

Since:
2012.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the point relative to which the coordinates in this vertex array are defined.
    getData(int aVertexAttributeIndex)
    Returns the buffer that contains the vertex array's data.
    getData(ILspVertexAttribute aVertexAttribute)
    Returns the buffer that contains the data for the given vertex attribute.
    int
    Returns the number of vertices in this array.
    getVertexAttribute(int aVertexAttributeIndex)
    Returns the descriptor of the specified vertex attribute.
    int
    Returns the number of attributes of the vertices in this array.
    boolean
    Checks whether this vertex array has the given vertex attribute.
    void
    Obtains exclusive access to this vertex array for the calling thread.
    void
    Releases a previously obtained lock on this vertex array.
  • Method Details

    • getVertexAttributeCount

      int getVertexAttributeCount()
      Returns the number of attributes of the vertices in this array.
      Returns:
      the number of attributes of the vertices in this array
    • getVertexAttribute

      ILspVertexAttribute getVertexAttribute(int aVertexAttributeIndex)
      Returns the descriptor of the specified vertex attribute.
      Parameters:
      aVertexAttributeIndex - an index between zero and getVertexAttributeCount()
      Returns:
      an ILspVertexAttribute
    • hasVertexAttribute

      boolean hasVertexAttribute(ILspVertexAttribute aVertexAttribute)
      Checks whether this vertex array has the given vertex attribute.
      Parameters:
      aVertexAttribute - the vertex attribute
      Returns:
      whether or not this array contains the given attribute
    • lock

      void lock()
      Obtains exclusive access to this vertex array for the calling thread. This method should be called when rendering from the vertex array and when modifying its contents. Each call to lock() must be paired with a call to unlock().
    • unlock

      void unlock()
      Releases a previously obtained lock on this vertex array. This method must only be called if the calling thread has previously acquired a lock on the vertex array using lock().
    • getData

      Buffer getData(int aVertexAttributeIndex)
      Returns the buffer that contains the vertex array's data. For interleaved vertex arrays, the same buffer should be returned for every vertex attribute.
      Parameters:
      aVertexAttributeIndex - the index of the vertex attribute to get the buffer for
      Returns:
      the buffer that contains the vertex array's data
    • getData

      Buffer getData(ILspVertexAttribute aVertexAttribute)
      Returns the buffer that contains the data for the given vertex attribute. Can return null if no data is stored for the given attribute.
      Parameters:
      aVertexAttribute - the attribute to retrieve the data for
      Returns:
      the buffer that contains the data for the given vertex attribute, or null if no data is available
    • getCoordinateOrigin

      ILcdPoint getCoordinateOrigin()
      Returns the point relative to which the coordinates in this vertex array are defined. This method may return null if the vertex array is defined in absolute world coordinates.
      Returns:
      the point relative to which the coordinates in this vertex array are defined
    • getSize

      int getSize()
      Returns the number of vertices in this array.
      Returns:
      the number of vertices in this vertex array