com.io7m.jcanephora.core.api

## Interface JCGLDrawType

-     public interface JCGLDrawType

  Drawing commands.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `draw(JCGLPrimitives p, int first, int count)` Draw `count - 1` primitives of type `p`, starting at element `first`, taking the data from each currently active vertex attribute.
    `void` | `drawElements(JCGLPrimitives p)` Draw primitives of type `p`, taking the data from each currently active vertex attribute using elements taken from the currently bound index buffer.
    `void` | `drawElementsInstanced(JCGLPrimitives p, int instances)` Draw `instances` copies of primitives of type `p`, taking the data from each currently active vertex attribute using elements taken from the currently bound index buffer.
    `void` | `drawInstanced(JCGLPrimitives p, int first, int count, int instances)` Draw `instances` copies of `count - 1` primitives of type `p`, starting at element `first`, taking the data from each currently active vertex attribute.

- - ### Method Detail

    - #### draw

          void draw(JCGLPrimitives p,
                    int first,
                    int count)
             throws JCGLException

      Draw `count - 1` primitives of type `p`, starting at element `first`, taking the data from each currently active vertex attribute.
      Parameters:
        `p` - The type of primitives
        `first` - The first element
        `count` - The number of primitives
      Throws:
        `JCGLException` - On OpenGL errors
      See Also:
        `JCGLArrayObjectsType`

    - #### drawInstanced

          void drawInstanced(JCGLPrimitives p,
                             int first,
                             int count,
                             int instances)
                      throws JCGLException

      Draw `instances` copies of `count - 1` primitives of type `p`, starting at element `first`, taking the data from each currently active vertex attribute.

      Implementations use the OpenGL instancing API internally to implement this method. For the sake of explanation, the OpenGL API makes this function morally equivalent to calling `draw(JCGLPrimitives, int, int)` in a loop `instances` times.

      Parameters:
        `p` - The type of primitives
        `first` - The first element
        `count` - The number of primitives
        `instances` - The number of instances
      Throws:
        `JCGLException` - On OpenGL errors
      See Also:
        `JCGLArrayObjectsType`

    - #### drawElements

          void drawElements(JCGLPrimitives p)
                     throws JCGLException,
                            JCGLExceptionBufferNotBound

      Draw primitives of type `p`, taking the data from each currently active vertex attribute using elements taken from the currently bound index buffer.
      Parameters:
        `p` - The type of primitives
      Throws:
        `JCGLException` - On OpenGL errors
        `JCGLExceptionBufferNotBound` - If no index buffer is currently bound
      See Also:
        `JCGLArrayObjectsType`

    - #### drawElementsInstanced

          void drawElementsInstanced(JCGLPrimitives p,
                                     int instances)
                              throws JCGLException,
                                     JCGLExceptionBufferNotBound

      Draw `instances` copies of primitives of type `p`, taking the data from each currently active vertex attribute using elements taken from the currently bound index buffer.

      Implementations use the OpenGL instancing API internally to implement this method. For the sake of explanation, the OpenGL API makes this function morally equivalent to calling `drawElements(JCGLPrimitives)` in a loop `instances` times.

      Parameters:
        `p` - The type of primitives
        `instances` - The number of instances
      Throws:
        `JCGLException` - On OpenGL errors
        `JCGLExceptionBufferNotBound` - If no index buffer is currently bound
      See Also:
        `JCGLArrayObjectsType`

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