Buffer objects are fundamental to the operation of OpenGL. Buffers are used as a source of data for vertices and indices, read through buffer textures
in shaders, used to transfer texture and image data into and out of textures and framebuffers, and may be written to by operations such as transform
feedback. OpenGL contains mechanisms to copy sections of buffers from one to another, but it has no mechanism to initialize the content of a buffer to a
known value. In effect, it has memcpy, but not memset.
This extension adds such a mechanism and has several use cases. Examples include clearing a pixel unpack buffer before transferring data to a texture or resetting buffer data to a known value before sparse updates through shader image stores or transform feedback.
Requires OpenGL 1.. Promoted to core in OpenGL 4..
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static void | glClearBufferData(int target, int
the internal format with which the data will be stored in the buffer object internalformat, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, ByteBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.Fills a buffer object's data store with a fixed value. |
| public static void | glClearBufferData(int target, int
the internal format with which the data will be stored in the buffer object internalformat, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, ShortBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.Fills a buffer object's data store with a fixed value. |
| public static void | glClearBufferData(int target, int
the internal format with which the data will be stored in the buffer object internalformat, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, IntBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.Fills a buffer object's data store with a fixed value. |
| public static void | glClearBufferData(int target, int
the internal format with which the data will be stored in the buffer object internalformat, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, FloatBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.Fills a buffer object's data store with a fixed value. |
| public static void | glClearBufferData(int target, int internalformat, int format, int type, short[] data)
Array version of: |
| public static void | glClearBufferData(int target, int internalformat, int format, int type, int[] data)
Array version of: |
| public static void | glClearBufferData(int target, int internalformat, int format, int type, float[] data)
Array version of: |
| public static void | glClearBufferSubData(int target, int
the internal format with which the data will be stored in the buffer object internalformat, long the offset, in basic machine units into the buffer object's data store at which to start filling offset, long the size, in basic machine units of the range of the data store to fill size, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, ByteBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.Fills all or part of buffer object's data store with a fixed value. |
| public static void | glClearBufferSubData(int target, int
the internal format with which the data will be stored in the buffer object internalformat, long the offset, in basic machine units into the buffer object's data store at which to start filling offset, long the size, in basic machine units of the range of the data store to fill size, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, ShortBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.Fills all or part of buffer object's data store with a fixed value. |
| public static void | glClearBufferSubData(int target, int
the internal format with which the data will be stored in the buffer object internalformat, long the offset, in basic machine units into the buffer object's data store at which to start filling offset, long the size, in basic machine units of the range of the data store to fill size, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, IntBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.Fills all or part of buffer object's data store with a fixed value. |
| public static void | glClearBufferSubData(int target, int
the internal format with which the data will be stored in the buffer object internalformat, long the offset, in basic machine units into the buffer object's data store at which to start filling offset, long the size, in basic machine units of the range of the data store to fill size, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, FloatBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.Fills all or part of buffer object's data store with a fixed value. |
| public static void | glClearBufferSubData(int target, int internalformat, long offset, long size, int format, int type, short[] data)
Array version of: |
| public static void | glClearBufferSubData(int target, int internalformat, long offset, long size, int format, int type, int[] data)
Array version of: |
| public static void | glClearBufferSubData(int target, int internalformat, long offset, long size, int format, int type, float[] data)
Array version of: |
| public static void | glClearNamedBufferDataEXT(int
the buffer object to clear buffer, int the internal format with which the data will be stored in the buffer object internalformat, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, ByteBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.DSA version of |
| public static void | glClearNamedBufferDataEXT(int
the buffer object to clear buffer, int the internal format with which the data will be stored in the buffer object internalformat, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, ShortBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.DSA version of |
| public static void | glClearNamedBufferDataEXT(int
the buffer object to clear buffer, int the internal format with which the data will be stored in the buffer object internalformat, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, IntBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.DSA version of |
| public static void | glClearNamedBufferDataEXT(int
the buffer object to clear buffer, int the internal format with which the data will be stored in the buffer object internalformat, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, FloatBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.DSA version of |
| public static void | glClearNamedBufferDataEXT(int buffer, int internalformat, int format, int type, short[] data)
Array version of: |
| public static void | glClearNamedBufferDataEXT(int buffer, int internalformat, int format, int type, int[] data)
Array version of: |
| public static void | glClearNamedBufferDataEXT(int buffer, int internalformat, int format, int type, float[] data)
Array version of: |
| public static void | glClearNamedBufferSubDataEXT(int
the buffer object to clear buffer, int the internal format with which the data will be stored in the buffer object internalformat, long the offset, in basic machine units into the buffer object's data store at which to start filling offset, long the size, in basic machine units of the range of the data store to fill size, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, ByteBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.DSA version of |
| public static void | glClearNamedBufferSubDataEXT(int
the buffer object to clear buffer, int the internal format with which the data will be stored in the buffer object internalformat, long the offset, in basic machine units into the buffer object's data store at which to start filling offset, long the size, in basic machine units of the range of the data store to fill size, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, ShortBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.DSA version of |
| public static void | glClearNamedBufferSubDataEXT(int
the buffer object to clear buffer, int the internal format with which the data will be stored in the buffer object internalformat, long the offset, in basic machine units into the buffer object's data store at which to start filling offset, long the size, in basic machine units of the range of the data store to fill size, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, IntBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.DSA version of |
| public static void | glClearNamedBufferSubDataEXT(int
the buffer object to clear buffer, int the internal format with which the data will be stored in the buffer object internalformat, long the offset, in basic machine units into the buffer object's data store at which to start filling offset, long the size, in basic machine units of the range of the data store to fill size, int the format of the data in memory addressed by format, int data. One of:the type of the data in memory addressed by type, FloatBuffer data. One of:the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format
specified by internalformat, and then used to fill the specified range of the destination buffer. If data is data)NULL, then it is ignored and the
sub-range of the buffer is filled with zeros.DSA version of |
| public static void | glClearNamedBufferSubDataEXT(int buffer, int internalformat, long offset, long size, int format, int type, short[] data)
Array version of: |
| public static void | glClearNamedBufferSubDataEXT(int buffer, int internalformat, long offset, long size, int format, int type, int[] data)
Array version of: |
| public static void | glClearNamedBufferSubDataEXT(int buffer, int internalformat, long offset, long size, int format, int type, float[] data)
Array version of: |
| public static void | nglClearBufferData(int target, int internalformat, int format, int type, long data)
Unsafe version of: |
| public static void | nglClearBufferSubData(int target, int internalformat, long offset, long size, int format, int type, long data)
Unsafe version of: |
| public static native void | nglClearNamedBufferDataEXT(int buffer, int internalformat, int format, int type, long data)
Unsafe version of: |
| public static native void | nglClearNamedBufferSubDataEXT(int buffer, int internalformat, long offset, long size, int format, int type, long data)
Unsafe version of: |