This extension defines an interface that allows various types of data (especially vertex array data) to be cached in high-performance graphics memory on the server, thereby increasing the rate of data transfers.
Chunks of data are encapsulated within "buffer objects", which conceptually are nothing more than arrays of bytes, just like any chunk of memory. An API
is provided whereby applications can read from or write to buffers, either via the GL itself (BufferDataARB, BufferSubDataARB,
GetBufferSubDataARB) or via a pointer to the memory.
The latter technique is known as "mapping" a buffer. When an application maps a buffer, it is given a pointer to the memory. When the application finishes reading from or writing to the memory, it is required to "unmap" the buffer before it is once again permitted to use that buffer as a GL data source or sink. Mapping often allows applications to eliminate an extra data copy otherwise required to access the buffer, thereby enhancing performance. In addition, requiring that applications unmap the buffer to use it as a data source or sink ensures that certain classes of latent synchronization bugs cannot occur.
Although this extension only defines hooks for buffer objects to be used with OpenGL's vertex array APIs, the API defined in this extension permits buffer objects to be used as either data sources or sinks for any GL command that takes a pointer as an argument. Normally, in the absence of this extension, a pointer passed into the GL is simply a pointer to the user's data. This extension defines a mechanism whereby this pointer is used not as a pointer to the data itself, but as an offset into a currently bound buffer object. The buffer object ID zero is reserved, and when buffer object zero is bound to a given target, the commands affected by that buffer binding behave normally. When a nonzero buffer ID is bound, then the pointer represents an offset.
In the case of vertex arrays, this extension defines not merely one binding for all attributes, but a separate binding for each individual attribute. As a result, applications can source their attributes from multiple buffers. An application might, for example, have a model with constant texture coordinates and variable geometry. The texture coordinates might be retrieved from a buffer object with the usage mode "STATIC_DRAW", indicating to the GL that the application does not expect to update the contents of the buffer frequently or even at all, while the vertices might be retrieved from a buffer object with the usage mode "STREAM_DRAW", indicating that the vertices will be updated on a regular basis.
In addition, a binding is defined by which applications can source index data (as used by DrawElements, DrawRangeElements, and
MultiDrawElements) from a buffer object. On some platforms, this enables very large models to be rendered with no more than a few small commands
to the graphics device.
It is expected that a future extension will allow sourcing pixel data from and writing pixel data to a buffer object.
Promoted to core in OpenGL 1..
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_ARRAY_BUFFER_ARB
Accepted by the |
| public static final int | GL_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_BUFFER_ACCESS_ARB
Accepted by the |
| public static final int | GL_BUFFER_MAP_POINTER_ARB
Accepted by the |
| public static final int | GL_BUFFER_MAPPED_ARB
Accepted by the |
| public static final int | GL_BUFFER_SIZE_ARB
Accepted by the |
| public static final int | GL_BUFFER_USAGE_ARB
Accepted by the |
| public static final int | GL_COLOR_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_DYNAMIC_COPY_ARB
Accepted by the |
| public static final int | GL_DYNAMIC_DRAW_ARB
Accepted by the |
| public static final int | GL_DYNAMIC_READ_ARB
Accepted by the |
| public static final int | GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_ELEMENT_ARRAY_BUFFER_ARB
Accepted by the |
| public static final int | GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_INDEX_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_READ_ONLY_ARB
Accepted by the |
| public static final int | GL_READ_WRITE_ARB
Accepted by the |
| public static final int | GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_STATIC_COPY_ARB
Accepted by the |
| public static final int | GL_STATIC_DRAW_ARB
Accepted by the |
| public static final int | GL_STATIC_READ_ARB
Accepted by the |
| public static final int | GL_STREAM_COPY_ARB
Accepted by the |
| public static final int | GL_STREAM_DRAW_ARB
Accepted by the |
| public static final int | GL_STREAM_READ_ARB
Accepted by the |
| public static final int | GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB
Accepted by the |
| public static final int | GL_WRITE_ONLY_ARB
Accepted by the |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| public static native void | glBindBufferARB(int
the target to which the buffer object is bound. One of: target, int the name of a buffer object buffer)Binds a named buffer object. | |||||||||
| public static void | glBufferDataARB(int target, long
the size in bytes of the buffer object's new data store size, int the expected usage pattern of the data store. One of: usage)
Creates and initializes a buffer object's data store. | |||||||||
| public static void | glBufferDataARB(int target, ByteBuffer
a pointer to data that will be copied into the data store for initialization, or data, int NULL if no data is to be copiedthe expected usage pattern of the data store. One of: usage)
Creates and initializes a buffer object's data store. | |||||||||
| public static void | glBufferDataARB(int target, ShortBuffer
a pointer to data that will be copied into the data store for initialization, or data, int NULL if no data is to be copiedthe expected usage pattern of the data store. One of: usage)
Creates and initializes a buffer object's data store. | |||||||||
| public static void | glBufferDataARB(int target, IntBuffer
a pointer to data that will be copied into the data store for initialization, or data, int NULL if no data is to be copiedthe expected usage pattern of the data store. One of: usage)
Creates and initializes a buffer object's data store. | |||||||||
| public static void | glBufferDataARB(int target, FloatBuffer
a pointer to data that will be copied into the data store for initialization, or data, int NULL if no data is to be copiedthe expected usage pattern of the data store. One of: usage)
Creates and initializes a buffer object's data store. | |||||||||
| public static void | glBufferDataARB(int target, DoubleBuffer
a pointer to data that will be copied into the data store for initialization, or data, int NULL if no data is to be copiedthe expected usage pattern of the data store. One of: usage)
Creates and initializes a buffer object's data store. | |||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static void | glBufferSubDataARB(int target, long
the offset into the buffer object's data store where data replacement will begin, measured in bytes offset, ByteBuffer a pointer to the new data that will be copied into the data store data)Updates a subset of a buffer object's data store. | |||||||||
| public static void | glBufferSubDataARB(int target, long
the offset into the buffer object's data store where data replacement will begin, measured in bytes offset, ShortBuffer a pointer to the new data that will be copied into the data store data)Updates a subset of a buffer object's data store. | |||||||||
| public static void | glBufferSubDataARB(int target, long
the offset into the buffer object's data store where data replacement will begin, measured in bytes offset, IntBuffer a pointer to the new data that will be copied into the data store data)Updates a subset of a buffer object's data store. | |||||||||
| public static void | glBufferSubDataARB(int target, long
the offset into the buffer object's data store where data replacement will begin, measured in bytes offset, FloatBuffer a pointer to the new data that will be copied into the data store data)Updates a subset of a buffer object's data store. | |||||||||
| public static void | glBufferSubDataARB(int target, long
the offset into the buffer object's data store where data replacement will begin, measured in bytes offset, DoubleBuffer a pointer to the new data that will be copied into the data store data)Updates a subset of a buffer object's data store. | |||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static void | glDeleteBuffersARB(IntBuffer
an array of buffer objects to be deleted buffers)Deletes named buffer objects. | |||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static void | glGenBuffersARB(IntBuffer
a buffer in which the generated buffer object names are stored buffers)Generates buffer object names. | |||||||||
| public static int | ||||||||||
| public static void | ||||||||||
| public static int | glGetBufferParameteriARB(int target, int
the symbolic name of a buffer object parameter. One of: pname)
Returns the value of a buffer object parameter. | |||||||||
| public static void | glGetBufferParameterivARB(int target, int
the symbolic name of a buffer object parameter. One of: pname, IntBuffer
the requested parameter params)Returns the value of a buffer object parameter. | |||||||||
| public static void | glGetBufferParameterivARB(int target, int pname, int[] params)
Array version of: | |||||||||
| public static long | glGetBufferPointerARB(int target, int
the pointer to be returned. Must be: pname)
Returns the pointer to a mapped buffer object's data store. | |||||||||
| public static void | glGetBufferPointervARB(int target, int
the pointer to be returned. Must be: pname, PointerBuffer
the pointer value specified by params)pnameReturns the pointer to a mapped buffer object's data store. | |||||||||
| public static void | glGetBufferSubDataARB(int target, long
the offset into the buffer object's data store from which data will be returned, measured in bytes offset, ByteBuffer a pointer to the location where buffer object data is returned data)Returns a subset of a buffer object's data store. | |||||||||
| public static void | glGetBufferSubDataARB(int target, long
the offset into the buffer object's data store from which data will be returned, measured in bytes offset, ShortBuffer a pointer to the location where buffer object data is returned data)Returns a subset of a buffer object's data store. | |||||||||
| public static void | glGetBufferSubDataARB(int target, long
the offset into the buffer object's data store from which data will be returned, measured in bytes offset, IntBuffer a pointer to the location where buffer object data is returned data)Returns a subset of a buffer object's data store. | |||||||||
| public static void | glGetBufferSubDataARB(int target, long
the offset into the buffer object's data store from which data will be returned, measured in bytes offset, FloatBuffer a pointer to the location where buffer object data is returned data)Returns a subset of a buffer object's data store. | |||||||||
| public static void | glGetBufferSubDataARB(int target, long
the offset into the buffer object's data store from which data will be returned, measured in bytes offset, DoubleBuffer a pointer to the location where buffer object data is returned data)Returns a subset of a buffer object's data store. | |||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static void | ||||||||||
| public static native boolean | glIsBufferARB(int
a value that may be the name of a buffer object buffer)Determines if a name corresponds to a buffer object. | |||||||||
| public static ByteBuffer | glMapBufferARB(int
the target buffer object being mapped. One of: target, int the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of: access)
Maps a buffer object's data store. | |||||||||
| public static ByteBuffer | glMapBufferARB(int
the target buffer object being mapped. One of: target, int the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of: access, ByteBuffer old_buffer)
Maps a buffer object's data store. | |||||||||
| public static ByteBuffer | glMapBufferARB(int
the target buffer object being mapped. One of: target, int the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of: access, long length, ByteBuffer old_buffer)
Maps a buffer object's data store. | |||||||||
| public static native boolean | glUnmapBufferARB(int
the target buffer object being unmapped. One of: target)Relinquishes the mapping of a buffer object and invalidates the pointer to its data store. | |||||||||
| public static native void | nglBufferDataARB(int target, long
the size in bytes of the buffer object's new data store size, long data, int usage)Unsafe version of: | |||||||||
| public static native void | nglBufferSubDataARB(int target, long offset, long
the size in bytes of the data store region being replaced size, long data)Unsafe version of: | |||||||||
| public static native void | nglDeleteBuffersARB(int
the number of buffer objects to be deleted n, long buffers)Unsafe version of: | |||||||||
| public static native void | nglGenBuffersARB(int
the number of buffer object names to be generated n, long buffers)Unsafe version of: | |||||||||
| public static native void | nglGetBufferParameterivARB(int target, int pname, long params)
Unsafe version of: | |||||||||
| public static native void | ||||||||||
| public static native void | nglGetBufferSubDataARB(int target, long offset, long
the size in bytes of the data store region being returned size, long data)Unsafe version of: | |||||||||
| public static native long |