Class GLArrayDataServer

    • Constructor Detail

      • GLArrayDataServer

        public GLArrayDataServer​(GLArrayDataServer src)
        Copy Constructor

        Buffer is sliced, i.e. sharing content but using own state.

        All other values are simply copied.

    • Method Detail

      • createFixed

        public static GLArrayDataServer createFixed​(int index,
                                                    int compsPerElement,
                                                    int dataType,
                                                    boolean normalized,
                                                    int stride,
                                                    Buffer buffer,
                                                    int vboUsage)
                                             throws GLException
        Create a VBO, using a predefined fixed function array index and starting with a given Buffer object incl it's stride On profiles GL2 and ES1 the fixed function pipeline behavior is as expected. On profile ES2 the fixed function emulation will transform these calls to EnableVertexAttribArray and VertexAttribPointer calls, and a predefined vertex attribute variable name will be chosen. The default name mapping will be used, see GLPointerFuncUtil.getPredefinedArrayIndexName(int).
        Parameters:
        index - The GL array index
        compsPerElement - component count per element
        dataType - The component's OpenGL data type
        normalized - Whether the data shall be normalized
        stride - in bytes from one element to the other. If zero, compsPerElement * compSizeInBytes
        buffer - the user define data
        vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAW
        Throws:
        GLException
        See Also:
        com.jogamp.opengl.GLContext#getPredefinedArrayIndexName(int)
      • createFixed

        public static GLArrayDataServer createFixed​(int index,
                                                    int compsPerElement,
                                                    int dataType,
                                                    boolean normalized,
                                                    int initialElementCount,
                                                    int vboUsage)
                                             throws GLException
        Create a VBO, using a predefined fixed function array index and starting with a new created Buffer object with initialElementCount size On profiles GL2 and ES1 the fixed function pipeline behavior is as expected. On profile ES2 the fixed function emulation will transform these calls to EnableVertexAttribArray and VertexAttribPointer calls, and a predefined vertex attribute variable name will be chosen. The default name mapping will be used, see GLPointerFuncUtil.getPredefinedArrayIndexName(int).
        Parameters:
        index - The GL array index
        compsPerElement - component count per element
        dataType - The component's OpenGL data type
        normalized - Whether the data shall be normalized
        initialElementCount -
        vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAW
        Throws:
        GLException
        See Also:
        com.jogamp.opengl.GLContext#getPredefinedArrayIndexName(int)
      • createGLSL

        public static GLArrayDataServer createGLSL​(String name,
                                                   int compsPerElement,
                                                   int dataType,
                                                   boolean normalized,
                                                   int initialElementCount,
                                                   int vboUsage)
                                            throws GLException
        Create a VBO, using a custom GLSL array attribute name and starting with a new created Buffer object with initialElementCount size
        Parameters:
        name - The custom name for the GL attribute
        compsPerElement - component count per element
        dataType - The component's OpenGL data type
        normalized - Whether the data shall be normalized
        initialElementCount -
        vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAW
        Throws:
        GLException
      • createGLSL

        public static GLArrayDataServer createGLSL​(String name,
                                                   int compsPerElement,
                                                   int dataType,
                                                   boolean normalized,
                                                   int stride,
                                                   Buffer buffer,
                                                   int vboUsage)
                                            throws GLException
        Create a VBO, using a custom GLSL array attribute name and starting with a given Buffer object incl it's stride
        Parameters:
        name - The custom name for the GL attribute
        compsPerElement - component count per element
        dataType - The component's OpenGL data type
        normalized - Whether the data shall be normalized
        stride - in bytes from one element to the other. If zero, compsPerElement * compSizeInBytes
        buffer - the user define data
        vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAW
        Throws:
        GLException
      • createFixedInterleaved

        public static GLArrayDataServer createFixedInterleaved​(int compsPerElement,
                                                               int dataType,
                                                               boolean normalized,
                                                               int initialElementCount,
                                                               int vboUsage)
                                                        throws GLException
        Create a VBO for fixed function interleaved array data starting with a new created Buffer object with initialElementCount size.

        User needs to configure the interleaved segments via addFixedSubArray(int, int, int).

        Parameters:
        compsPerElement - The total number of all interleaved components per element.
        dataType - The component's OpenGL data type
        normalized - Whether the data shall be normalized
        initialElementCount - The initial number of all interleaved elements
        vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAW
        Throws:
        GLException
      • createFixedInterleaved

        public static GLArrayDataServer createFixedInterleaved​(int compsPerElement,
                                                               int dataType,
                                                               boolean normalized,
                                                               int stride,
                                                               Buffer buffer,
                                                               int vboUsage)
                                                        throws GLException
        Create a VBO for fixed function interleaved array data starting with a given Buffer object incl it's stride

        User needs to configure the interleaved segments via addFixedSubArray(int, int, int).

        Parameters:
        compsPerElement - The total number of all interleaved components per element.
        dataType - The component's OpenGL data type
        normalized - Whether the data shall be normalized
        stride - in bytes from one element of a sub-array to the other. If zero, compsPerElement * compSizeInBytes
        buffer - The user define data of all interleaved elements
        vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAW
        Throws:
        GLException
      • createGLSLInterleaved

        public static GLArrayDataServer createGLSLInterleaved​(int compsPerElement,
                                                              int dataType,
                                                              boolean normalized,
                                                              int initialElementCount,
                                                              int vboUsage)
                                                       throws GLException
        Create a VBO for GLSL interleaved array data starting with a new created Buffer object with initialElementCount size.

        User needs to configure the interleaved segments via #addGLSLSubArray(int, int, int).

        Parameters:
        compsPerElement - The total number of all interleaved components per element.
        dataType - The component's OpenGL data type
        normalized - Whether the data shall be normalized
        initialElementCount - The initial number of all interleaved elements
        vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAW
        Throws:
        GLException
      • createGLSLInterleavedMapped

        public static GLArrayDataServer createGLSLInterleavedMapped​(int compsPerElement,
                                                                    int dataType,
                                                                    boolean normalized,
                                                                    int mappedElementCount,
                                                                    int vboUsage)
                                                             throws GLException
        Create a VBO for GLSL interleaved array data intended for GPU buffer storage mapping, see GLBufferStorage, via mapStorage(GL, int) and mapStorage(GL, long, long, int).

        User needs to configure the interleaved segments via #addGLSLSubArray(int, int, int).

        Parameters:
        compsPerElement - The total number of all interleaved components per element.
        dataType - The component's OpenGL data type
        normalized - Whether the data shall be normalized
        mappedElementCount - The total number of all interleaved elements
        vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAW
        Throws:
        GLException
      • createGLSLInterleaved

        public static GLArrayDataServer createGLSLInterleaved​(int compsPerElement,
                                                              int dataType,
                                                              boolean normalized,
                                                              int stride,
                                                              Buffer buffer,
                                                              int vboUsage)
                                                       throws GLException
        Create a VBO for GLSL interleaved array data starting with a given Buffer object incl it's stride

        User needs to configure the interleaved segments via #addGLSLSubArray(int, int, int).

        Parameters:
        compsPerElement - The total number of all interleaved components per element.
        dataType - The component's OpenGL data type
        normalized - Whether the data shall be normalized
        stride - in bytes from one element of a sub-array to the other. If zero, compsPerElement * compSizeInBytes
        buffer - The user define data of all interleaved elements
        vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAW
        Throws:
        GLException
      • setInterleavedOffset

        public final void setInterleavedOffset​(int interleavedOffset)
      • getInterleavedOffset

        public final int getInterleavedOffset()
      • mapStorage

        public GLBufferStorage mapStorage​(GL gl,
                                          long offset,
                                          long length,
                                          int access)
      • unmapStorage

        public void unmapStorage​(GL gl)