Class ARBMultiDrawIndirect


  • public class ARBMultiDrawIndirect
    extends java.lang.Object
    Native bindings to the ARB_multi_draw_indirect extension.

    The ARB_draw_indirect extension (included in OpenGL 4.0) introduced mechanisms whereby the parameters for a draw function may be provided in a structure contained in a buffer object rather than as parameters to the drawing procedure. This is known as an indirect draw and is exposed as two new functions, DrawArraysIndirect and DrawElementsIndirect. Each of these functions generates a single batch of primitives.

    This extension builds on this functionality by providing procedures to invoke multiple draws from a single procedure call. This allows large batches of drawing commands to be assembled in server memory (via a buffer object) which may then be dispatched through a single function call.

    Requires OpenGL 4.0 or ARB_draw_indirect. Promoted to core in OpenGL 4.3.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void glMultiDrawArraysIndirect​(int mode, int[] indirect, int primcount, int stride)
      Array version of: MultiDrawArraysIndirect
      static void glMultiDrawArraysIndirect​(int mode, long indirect, int primcount, int stride)
      Renders multiple sets of primitives from array data, taking parameters from memory.
      static void glMultiDrawArraysIndirect​(int mode, java.nio.ByteBuffer indirect, int primcount, int stride)
      Renders multiple sets of primitives from array data, taking parameters from memory.
      static void glMultiDrawArraysIndirect​(int mode, java.nio.IntBuffer indirect, int primcount, int stride)
      Renders multiple sets of primitives from array data, taking parameters from memory.
      static void glMultiDrawElementsIndirect​(int mode, int type, int[] indirect, int primcount, int stride)
      Array version of: MultiDrawElementsIndirect
      static void glMultiDrawElementsIndirect​(int mode, int type, long indirect, int primcount, int stride)
      Renders multiple indexed primitives from array data, taking parameters from memory.
      static void glMultiDrawElementsIndirect​(int mode, int type, java.nio.ByteBuffer indirect, int primcount, int stride)
      Renders multiple indexed primitives from array data, taking parameters from memory.
      static void glMultiDrawElementsIndirect​(int mode, int type, java.nio.IntBuffer indirect, int primcount, int stride)
      Renders multiple indexed primitives from array data, taking parameters from memory.
      static void nglMultiDrawArraysIndirect​(int mode, long indirect, int primcount, int stride)
      Unsafe version of: MultiDrawArraysIndirect
      static void nglMultiDrawElementsIndirect​(int mode, int type, long indirect, int primcount, int stride)
      Unsafe version of: MultiDrawElementsIndirect
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • nglMultiDrawArraysIndirect

        public static void nglMultiDrawArraysIndirect​(int mode,
                                                      long indirect,
                                                      int primcount,
                                                      int stride)
        Unsafe version of: MultiDrawArraysIndirect
      • glMultiDrawArraysIndirect

        public static void glMultiDrawArraysIndirect​(int mode,
                                                     java.nio.ByteBuffer indirect,
                                                     int primcount,
                                                     int stride)
        
        public static void glMultiDrawArraysIndirect​(int mode,
                                                     long indirect,
                                                     int primcount,
                                                     int stride)
        
        public static void glMultiDrawArraysIndirect​(int mode,
                                                     java.nio.IntBuffer indirect,
                                                     int primcount,
                                                     int stride)
        
        Renders multiple sets of primitives from array data, taking parameters from memory.

        The parameters addressed by indirect are packed into an array of structures, each element of which takes the form (in C):

        
         typedef struct {
             uint count;
             uint primCount;
             uint first;
             uint baseInstance;
         } DrawArraysIndirectCommand;

        A single call to glMultiDrawArraysIndirect is equivalent, assuming no errors are generated to:

        
         const ubyte *ptr = (const ubyte *)indirect;
         for ( i = 0; i < primcount; i++ ) {
             DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
             if ( stride == 0 )
                 ptr += sizeof(DrawArraysIndirectCommand);
             else
                 ptr += stride;
         }
        Parameters:
        mode - what kind of primitives to render. One of:
        POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
        LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
        QUAD_STRIP
        indirect - an array of structures containing the draw parameters
        primcount - the number of elements in the array of draw parameter structures
        stride - the distance in basic machine units between elements of the draw parameter array
      • nglMultiDrawElementsIndirect

        public static void nglMultiDrawElementsIndirect​(int mode,
                                                        int type,
                                                        long indirect,
                                                        int primcount,
                                                        int stride)
        Unsafe version of: MultiDrawElementsIndirect
      • glMultiDrawElementsIndirect

        public static void glMultiDrawElementsIndirect​(int mode,
                                                       int type,
                                                       java.nio.ByteBuffer indirect,
                                                       int primcount,
                                                       int stride)
        
        public static void glMultiDrawElementsIndirect​(int mode,
                                                       int type,
                                                       long indirect,
                                                       int primcount,
                                                       int stride)
        
        public static void glMultiDrawElementsIndirect​(int mode,
                                                       int type,
                                                       java.nio.IntBuffer indirect,
                                                       int primcount,
                                                       int stride)
        
        Renders multiple indexed primitives from array data, taking parameters from memory.

        The parameters addressed by indirect are packed into a structure that takes the form (in C):

        
         typedef struct {
             uint count;
             uint primCount;
             uint firstIndex;
             uint baseVertex;
             uint baseInstance;
         } DrawElementsIndirectCommand;

        A single call to glMultiDrawElementsIndirect is equivalent, assuming no errors are generated to:

        
         const ubyte *ptr = (const ubyte *)indirect;
         for ( i = 0; i < primcount; i++ ) {
             DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
             if ( stride == 0 )
                 ptr += sizeof(DrawElementsIndirectCommand);
             else
                 ptr += stride;
         }
        Parameters:
        mode - what kind of primitives to render. One of:
        POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
        LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
        QUAD_STRIP
        type - the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
        UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
        indirect - a structure containing an array of draw parameters
        primcount - the number of elements in the array addressed by indirect
        stride - the distance in basic machine units between elements of the draw parameter array
      • glMultiDrawArraysIndirect

        public static void glMultiDrawArraysIndirect​(int mode,
                                                     int[] indirect,
                                                     int primcount,
                                                     int stride)
        Array version of: MultiDrawArraysIndirect
      • glMultiDrawElementsIndirect

        public static void glMultiDrawElementsIndirect​(int mode,
                                                       int type,
                                                       int[] indirect,
                                                       int primcount,
                                                       int stride)
        Array version of: MultiDrawElementsIndirect