GLDRAWARRAYSINSTANCE(3G)

    .SH "NAME" glDrawArraysInstanced - draw multiple instances of a range of elements
    .SH "C SPECIFICATION"

            .HP u void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount);

    .SH "PARAMETERS"

        .PP mode

                    Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_LINE_STRIP_ADJACENCY, GL_LINES_ADJACENCY, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_TRIANGLE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY and GL_PATCHES are accepted.

            .RE
            .PP first

                        Specifies the starting index in the enabled arrays.

                .RE
                .PP count

                            Specifies the number of indices to be rendered.

                    .RE
                    .PP primcount

                                Specifies the number of instances of the specified range of indices to be rendered.

                        .RE

                    .SH "DESCRIPTION"
                        .PP glDrawArraysInstanced behaves identically to glDrawArrays() except that primcount instances of the range of elements are executed. Those attributes that have divisor N where N is other than zero (as specified by glVertexAttribDivisor()) advance once every N instances. Thus, the element transferred from instanced vertex attributes is given by: instance divisor The value of instance may be read by a vertex shader as gl_InstanceID.
                        .PP To enable and disable a generic vertex attribute array, call glEnableVertexAttribArray() and glDisableVertexAttribArray().
                        .PP If an array corresponding to a generic attribute required by a vertex shader is not enabled, then the corresponding element is taken from the current generic attribute state.

                    .SH "NOTES"
                        .PP GL_LINE_STRIP_ADJACENCY, GL_LINES_ADJACENCY, GL_TRIANGLE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY and GL_PATCHES are available only if the GL ES version is 3.2 or greater.

                    .SH "ERRORS"
                        .PP GL_INVALID_ENUM is generated if mode is not one of the accepted values.
                        .PP GL_INVALID_VALUE is generated if count or primcount are negative.
                        .PP GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array and the buffer object's data store is currently mapped.
                        .PP GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus() is not GL_FRAMEBUFFER_COMPLETE).
                        .PP GL_INVALID_OPERATION is generated if recording the vertices of a primitive to the buffer objects being used for transform feedback purposes would result in either exceeding the limits of any buffer object’s size, or in exceeding the end position offset + size - 1, as set by glBindBufferRange().
                        .PP GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object.

                    .SH "API VERSION SUPPORT"

                        .TS allbox tab(:); l l l l l. T{ glDrawArraysInstanced T}:T{ T}:T{ T}:T{ T}:T{ T}

                    .SH "SEE ALSO"
                        .PP glCheckFramebufferStatus(), glDisableVertexAttribArray(), glDrawArrays(), glDrawElements(), glDrawElementsInstanced(), glEnableVertexAttribArray() , glVertexAttribDivisor()

                    .SH "COPYRIGHT"
                        .PP Copyright © 2010-2015 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

COPYRIGHT
Copyright © 2010-2015 Khronos Group