com.io7m.jcanephora.core.api

## Interface JCGLIndexBuffersType

-     public interface JCGLIndexBuffersType

  The interface to OpenGL index buffers.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `JCGLIndexBufferType` | `indexBufferAllocate(long indices, JCGLUnsignedType type, JCGLUsageHint usage)` Allocate and bind an index buffer of `indices` values of type `type`, informing the implementation that the buffer will be used in the manner specified by `usage`.
    `void` | `indexBufferBind(JCGLIndexBufferUsableType a)` Bind the given index buffer.
    `void` | `indexBufferDelete(JCGLIndexBufferType a)` Deletes the buffer referenced by `a`.
    `Optional<JCGLIndexBufferUsableType>` | `indexBufferGetCurrentlyBound()`
    `boolean` | `indexBufferIsBound()`
    `ByteBuffer` | `indexBufferRead(JCGLIndexBufferUsableType i, JCGLByteBufferProducerType f)`
    `void` | `indexBufferReallocate(JCGLIndexBufferUsableType i)` Reallocate the storage associated with the index buffer `i`.
    `void` | `indexBufferUnbind()` Unbind the current index buffer.
    `void` | `indexBufferUpdate(JCGLBufferUpdateType<JCGLIndexBufferType> u)` Perform the index buffer update `u`.

- - ### Method Detail

    - #### indexBufferRead

          ByteBuffer indexBufferRead(JCGLIndexBufferUsableType i,
                                     JCGLByteBufferProducerType f)
                              throws JCGLException,
                                     JCGLExceptionDeleted,
                                     JCGLExceptionBufferNotBound

      Parameters:
        `i` - The index buffer that will be read
        `f` - A function used to allocate the buffer
      Returns:
        The contents of the index buffer
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionDeleted` - If the index buffer has already been deleted
        `JCGLExceptionBufferNotBound` - If the index buffer `i` is not bound

    - #### indexBufferAllocate

          JCGLIndexBufferType indexBufferAllocate(long indices,
                                                  JCGLUnsignedType type,
                                                  JCGLUsageHint usage)

      Allocate and bind an index buffer of `indices` values of type `type`, informing the implementation that the buffer will be used in the manner specified by `usage`.

      The index buffer is bound to the current array object.

      Parameters:
        `indices` - The number of indices
        `type` - The type of indices
        `usage` - The usage hint
      Returns:
        An index buffer
      See Also:
        `JCGLArrayObjectsType`

    - #### indexBufferReallocate

          void indexBufferReallocate(JCGLIndexBufferUsableType i)
                              throws JCGLException,
                                     JCGLExceptionDeleted,
                                     JCGLExceptionBufferNotBound

      Reallocate the storage associated with the index buffer `i`.

      This is intended to facilitate streaming of buffer contents without incurring implicit synchronization by the OpenGL driver. The existing array buffer storage is "orphaned" and replaced by storage of the same size and with the same usage hint.

      Parameters:
        `i` - The array buffer
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionDeleted` - If the index buffer has already been deleted
        `JCGLExceptionBufferNotBound` - If the index buffer `i` is not bound

    - #### indexBufferGetCurrentlyBound

          Optional<JCGLIndexBufferUsableType> indexBufferGetCurrentlyBound()
                                                                    throws JCGLException

      Returns:
        The currently bound index buffer, if one exists
      Throws:
        `JCGLException` - Iff an OpenGL error occurs

    - #### indexBufferBind

          void indexBufferBind(JCGLIndexBufferUsableType a)
                        throws JCGLException,
                               JCGLExceptionDeleted

      Bind the given index buffer.
      Parameters:
        `a` - The index buffer
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionDeleted` - Iff the given index buffer has already been deleted

    - #### indexBufferUnbind

          void indexBufferUnbind()
                          throws JCGLException

      Unbind the current index buffer. If no buffer is bound, this call has no effect.
      Throws:
        `JCGLException` - Iff an OpenGL error occurs

    - #### indexBufferDelete

          void indexBufferDelete(JCGLIndexBufferType a)
                          throws JCGLException,
                                 JCGLExceptionDeleted

      Deletes the buffer referenced by `a`.

      Calling this method will unbind `a` iff it is bound.

      Parameters:
        `a` - The index buffer
      Throws:
        `JCGLExceptionDeleted` - If the index is already deleted
        `JCGLException` - Iff an OpenGL error occurs

    - #### indexBufferUpdate

          void indexBufferUpdate(JCGLBufferUpdateType<JCGLIndexBufferType> u)
                          throws JCGLException,
                                 JCGLExceptionDeleted,
                                 JCGLExceptionBufferNotBound

      Perform the index buffer update `u`.

      Parameters:
        `u` - The update
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionDeleted` - If the index buffer has already been deleted
        `JCGLExceptionBufferNotBound` - If the index buffer in `u` is not bound

    - #### indexBufferIsBound

          boolean indexBufferIsBound()

      Returns:
        `true` iff an index buffer is currently bound

Copyright © 2016 <code@io7m.com> http://io7m.com