Class ARBVertexBufferObject
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.5
.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Accepted by thetarget
parameters of BindBufferARB, BufferDataARB, BufferSubDataARB, MapBufferARB, UnmapBufferARB, GetBufferSubDataARB, GetBufferParameterivARB, and GetBufferPointervARB.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thepname
parameter of GetBufferParameterivARB.static final int
Accepted by thepname
parameter of GetBufferPointervARB.static final int
Accepted by thepname
parameter of GetBufferParameterivARB.static final int
Accepted by thepname
parameter of GetBufferParameterivARB.static final int
Accepted by thepname
parameter of GetBufferParameterivARB.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by theusage
parameter of BufferDataARB.static final int
Accepted by theusage
parameter of BufferDataARB.static final int
Accepted by theusage
parameter of BufferDataARB.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thetarget
parameters of BindBufferARB, BufferDataARB, BufferSubDataARB, MapBufferARB, UnmapBufferARB, GetBufferSubDataARB, GetBufferParameterivARB, and GetBufferPointervARB.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by theaccess
parameter of MapBufferARB.static final int
Accepted by theaccess
parameter of MapBufferARB.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by theusage
parameter of BufferDataARB.static final int
Accepted by theusage
parameter of BufferDataARB.static final int
Accepted by theusage
parameter of BufferDataARB.static final int
Accepted by theusage
parameter of BufferDataARB.static final int
Accepted by theusage
parameter of BufferDataARB.static final int
Accepted by theusage
parameter of BufferDataARB.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thepname
parameter of GetVertexAttribivARB.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by theaccess
parameter of MapBufferARB. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
glBindBufferARB
(int target, int buffer) Binds a named buffer object.static void
glBufferDataARB
(int target, double[] data, int usage) Array version of:BufferDataARB
static void
glBufferDataARB
(int target, float[] data, int usage) Array version of:BufferDataARB
static void
glBufferDataARB
(int target, int[] data, int usage) Array version of:BufferDataARB
static void
glBufferDataARB
(int target, long size, int usage) Creates and initializes a buffer object's data store.static void
glBufferDataARB
(int target, short[] data, int usage) Array version of:BufferDataARB
static void
glBufferDataARB
(int target, ByteBuffer data, int usage) Creates and initializes a buffer object's data store.static void
glBufferDataARB
(int target, DoubleBuffer data, int usage) Creates and initializes a buffer object's data store.static void
glBufferDataARB
(int target, FloatBuffer data, int usage) Creates and initializes a buffer object's data store.static void
glBufferDataARB
(int target, IntBuffer data, int usage) Creates and initializes a buffer object's data store.static void
glBufferDataARB
(int target, ShortBuffer data, int usage) Creates and initializes a buffer object's data store.static void
glBufferSubDataARB
(int target, long offset, double[] data) Array version of:BufferSubDataARB
static void
glBufferSubDataARB
(int target, long offset, float[] data) Array version of:BufferSubDataARB
static void
glBufferSubDataARB
(int target, long offset, int[] data) Array version of:BufferSubDataARB
static void
glBufferSubDataARB
(int target, long offset, short[] data) Array version of:BufferSubDataARB
static void
glBufferSubDataARB
(int target, long offset, ByteBuffer data) Updates a subset of a buffer object's data store.static void
glBufferSubDataARB
(int target, long offset, DoubleBuffer data) Updates a subset of a buffer object's data store.static void
glBufferSubDataARB
(int target, long offset, FloatBuffer data) Updates a subset of a buffer object's data store.static void
glBufferSubDataARB
(int target, long offset, IntBuffer data) Updates a subset of a buffer object's data store.static void
glBufferSubDataARB
(int target, long offset, ShortBuffer data) Updates a subset of a buffer object's data store.static void
glDeleteBuffersARB
(int buffer) Deletes named buffer objects.static void
glDeleteBuffersARB
(int[] buffers) Array version of:DeleteBuffersARB
static void
glDeleteBuffersARB
(IntBuffer buffers) Deletes named buffer objects.static int
Generates buffer object names.static void
glGenBuffersARB
(int[] buffers) Array version of:GenBuffersARB
static void
glGenBuffersARB
(IntBuffer buffers) Generates buffer object names.static int
glGetBufferParameteriARB
(int target, int pname) Returns the value of a buffer object parameter.static void
glGetBufferParameterivARB
(int target, int pname, int[] params) Array version of:GetBufferParameterivARB
static void
glGetBufferParameterivARB
(int target, int pname, IntBuffer params) Returns the value of a buffer object parameter.static long
glGetBufferPointerARB
(int target, int pname) Returns the pointer to a mapped buffer object's data store.static void
glGetBufferPointervARB
(int target, int pname, PointerBuffer params) Returns the pointer to a mapped buffer object's data store.static void
glGetBufferSubDataARB
(int target, long offset, double[] data) Array version of:GetBufferSubDataARB
static void
glGetBufferSubDataARB
(int target, long offset, float[] data) Array version of:GetBufferSubDataARB
static void
glGetBufferSubDataARB
(int target, long offset, int[] data) Array version of:GetBufferSubDataARB
static void
glGetBufferSubDataARB
(int target, long offset, short[] data) Array version of:GetBufferSubDataARB
static void
glGetBufferSubDataARB
(int target, long offset, ByteBuffer data) Returns a subset of a buffer object's data store.static void
glGetBufferSubDataARB
(int target, long offset, DoubleBuffer data) Returns a subset of a buffer object's data store.static void
glGetBufferSubDataARB
(int target, long offset, FloatBuffer data) Returns a subset of a buffer object's data store.static void
glGetBufferSubDataARB
(int target, long offset, IntBuffer data) Returns a subset of a buffer object's data store.static void
glGetBufferSubDataARB
(int target, long offset, ShortBuffer data) Returns a subset of a buffer object's data store.static boolean
glIsBufferARB
(int buffer) Determines if a name corresponds to a buffer object.static ByteBuffer
glMapBufferARB
(int target, int access) Maps a buffer object's data store.static ByteBuffer
glMapBufferARB
(int target, int access, long length, ByteBuffer old_buffer) Maps a buffer object's data store.static ByteBuffer
glMapBufferARB
(int target, int access, ByteBuffer old_buffer) Maps a buffer object's data store.static boolean
glUnmapBufferARB
(int target) Relinquishes the mapping of a buffer object and invalidates the pointer to its data store.static void
nglBufferDataARB
(int target, long size, long data, int usage) Unsafe version of:BufferDataARB
static void
nglBufferSubDataARB
(int target, long offset, long size, long data) Unsafe version of:BufferSubDataARB
static void
nglDeleteBuffersARB
(int n, long buffers) Unsafe version of:DeleteBuffersARB
static void
nglGenBuffersARB
(int n, long buffers) Unsafe version of:GenBuffersARB
static void
nglGetBufferParameterivARB
(int target, int pname, long params) Unsafe version of:GetBufferParameterivARB
static void
nglGetBufferPointervARB
(int target, int pname, long params) Unsafe version of:GetBufferPointervARB
static void
nglGetBufferSubDataARB
(int target, long offset, long size, long data) Unsafe version of:GetBufferSubDataARB
static long
nglMapBufferARB
(int target, int access) Unsafe version of:MapBufferARB
-
Field Details
-
GL_ARRAY_BUFFER_ARB
public static final int GL_ARRAY_BUFFER_ARBAccepted by thetarget
parameters of BindBufferARB, BufferDataARB, BufferSubDataARB, MapBufferARB, UnmapBufferARB, GetBufferSubDataARB, GetBufferParameterivARB, and GetBufferPointervARB.- See Also:
-
GL_ELEMENT_ARRAY_BUFFER_ARB
public static final int GL_ELEMENT_ARRAY_BUFFER_ARBAccepted by thetarget
parameters of BindBufferARB, BufferDataARB, BufferSubDataARB, MapBufferARB, UnmapBufferARB, GetBufferSubDataARB, GetBufferParameterivARB, and GetBufferPointervARB.- See Also:
-
GL_ARRAY_BUFFER_BINDING_ARB
public static final int GL_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
public static final int GL_VERTEX_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
public static final int GL_NORMAL_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_COLOR_ARRAY_BUFFER_BINDING_ARB
public static final int GL_COLOR_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_INDEX_ARRAY_BUFFER_BINDING_ARB
public static final int GL_INDEX_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
public static final int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
public static final int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
public static final int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
public static final int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB
public static final int GL_WEIGHT_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB
public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARBAccepted by thepname
parameter of GetVertexAttribivARB.- See Also:
-
GL_STREAM_DRAW_ARB
public static final int GL_STREAM_DRAW_ARBAccepted by theusage
parameter of BufferDataARB.- See Also:
-
GL_STREAM_READ_ARB
public static final int GL_STREAM_READ_ARBAccepted by theusage
parameter of BufferDataARB.- See Also:
-
GL_STREAM_COPY_ARB
public static final int GL_STREAM_COPY_ARBAccepted by theusage
parameter of BufferDataARB.- See Also:
-
GL_STATIC_DRAW_ARB
public static final int GL_STATIC_DRAW_ARBAccepted by theusage
parameter of BufferDataARB.- See Also:
-
GL_STATIC_READ_ARB
public static final int GL_STATIC_READ_ARBAccepted by theusage
parameter of BufferDataARB.- See Also:
-
GL_STATIC_COPY_ARB
public static final int GL_STATIC_COPY_ARBAccepted by theusage
parameter of BufferDataARB.- See Also:
-
GL_DYNAMIC_DRAW_ARB
public static final int GL_DYNAMIC_DRAW_ARBAccepted by theusage
parameter of BufferDataARB.- See Also:
-
GL_DYNAMIC_READ_ARB
public static final int GL_DYNAMIC_READ_ARBAccepted by theusage
parameter of BufferDataARB.- See Also:
-
GL_DYNAMIC_COPY_ARB
public static final int GL_DYNAMIC_COPY_ARBAccepted by theusage
parameter of BufferDataARB.- See Also:
-
GL_READ_ONLY_ARB
public static final int GL_READ_ONLY_ARBAccepted by theaccess
parameter of MapBufferARB.- See Also:
-
GL_WRITE_ONLY_ARB
public static final int GL_WRITE_ONLY_ARBAccepted by theaccess
parameter of MapBufferARB.- See Also:
-
GL_READ_WRITE_ARB
public static final int GL_READ_WRITE_ARBAccepted by theaccess
parameter of MapBufferARB.- See Also:
-
GL_BUFFER_SIZE_ARB
public static final int GL_BUFFER_SIZE_ARBAccepted by thepname
parameter of GetBufferParameterivARB.- See Also:
-
GL_BUFFER_USAGE_ARB
public static final int GL_BUFFER_USAGE_ARBAccepted by thepname
parameter of GetBufferParameterivARB.- See Also:
-
GL_BUFFER_ACCESS_ARB
public static final int GL_BUFFER_ACCESS_ARBAccepted by thepname
parameter of GetBufferParameterivARB.- See Also:
-
GL_BUFFER_MAPPED_ARB
public static final int GL_BUFFER_MAPPED_ARBAccepted by thepname
parameter of GetBufferParameterivARB.- See Also:
-
GL_BUFFER_MAP_POINTER_ARB
public static final int GL_BUFFER_MAP_POINTER_ARBAccepted by thepname
parameter of GetBufferPointervARB.- See Also:
-
-
Method Details
-
glBindBufferARB
public static void glBindBufferARB(int target, int buffer) Binds a named buffer object.- Parameters:
target
- the target to which the buffer object is bound. One of:buffer
- the name of a buffer object
-
nglDeleteBuffersARB
public static void nglDeleteBuffersARB(int n, long buffers) Unsafe version of:DeleteBuffersARB
- Parameters:
n
- the number of buffer objects to be deleted
-
glDeleteBuffersARB
Deletes named buffer objects.- Parameters:
buffers
- an array of buffer objects to be deleted
-
glDeleteBuffersARB
public static void glDeleteBuffersARB(int buffer) Deletes named buffer objects. -
nglGenBuffersARB
public static void nglGenBuffersARB(int n, long buffers) Unsafe version of:GenBuffersARB
- Parameters:
n
- the number of buffer object names to be generated
-
glGenBuffersARB
Generates buffer object names.- Parameters:
buffers
- a buffer in which the generated buffer object names are stored
-
glGenBuffersARB
public static int glGenBuffersARB()Generates buffer object names. -
glIsBufferARB
public static boolean glIsBufferARB(int buffer) Determines if a name corresponds to a buffer object.- Parameters:
buffer
- a value that may be the name of a buffer object
-
nglBufferDataARB
public static void nglBufferDataARB(int target, long size, long data, int usage) Unsafe version of:BufferDataARB
- Parameters:
size
- the size in bytes of the buffer object's new data store
-
glBufferDataARB
public static void glBufferDataARB(int target, long size, int usage) Creates and initializes a buffer object's data store.usage
is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store.usage
can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The frequency of access may be one of these:- STREAM - The data store contents will be modified once and used at most a few times.
- STATIC - The data store contents will be modified once and used many times.
- DYNAMIC - The data store contents will be modified repeatedly and used many times.
The nature of access may be one of these:
- DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
- READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
- COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
- Parameters:
target
- the target buffer object. One of:size
- the size in bytes of the buffer object's new data storeusage
- the expected usage pattern of the data store. One of:STREAM_DRAW_ARB
STREAM_READ_ARB
STREAM_COPY_ARB
STATIC_DRAW_ARB
STATIC_READ_ARB
STATIC_COPY_ARB
DYNAMIC_DRAW_ARB
DYNAMIC_READ_ARB
DYNAMIC_COPY_ARB
-
glBufferDataARB
Creates and initializes a buffer object's data store.usage
is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store.usage
can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The frequency of access may be one of these:- STREAM - The data store contents will be modified once and used at most a few times.
- STATIC - The data store contents will be modified once and used many times.
- DYNAMIC - The data store contents will be modified repeatedly and used many times.
The nature of access may be one of these:
- DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
- READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
- COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
- Parameters:
target
- the target buffer object. One of:data
- a pointer to data that will be copied into the data store for initialization, orNULL
if no data is to be copiedusage
- the expected usage pattern of the data store. One of:STREAM_DRAW_ARB
STREAM_READ_ARB
STREAM_COPY_ARB
STATIC_DRAW_ARB
STATIC_READ_ARB
STATIC_COPY_ARB
DYNAMIC_DRAW_ARB
DYNAMIC_READ_ARB
DYNAMIC_COPY_ARB
-
glBufferDataARB
Creates and initializes a buffer object's data store.usage
is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store.usage
can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The frequency of access may be one of these:- STREAM - The data store contents will be modified once and used at most a few times.
- STATIC - The data store contents will be modified once and used many times.
- DYNAMIC - The data store contents will be modified repeatedly and used many times.
The nature of access may be one of these:
- DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
- READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
- COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
- Parameters:
target
- the target buffer object. One of:data
- a pointer to data that will be copied into the data store for initialization, orNULL
if no data is to be copiedusage
- the expected usage pattern of the data store. One of:STREAM_DRAW_ARB
STREAM_READ_ARB
STREAM_COPY_ARB
STATIC_DRAW_ARB
STATIC_READ_ARB
STATIC_COPY_ARB
DYNAMIC_DRAW_ARB
DYNAMIC_READ_ARB
DYNAMIC_COPY_ARB
-
glBufferDataARB
Creates and initializes a buffer object's data store.usage
is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store.usage
can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The frequency of access may be one of these:- STREAM - The data store contents will be modified once and used at most a few times.
- STATIC - The data store contents will be modified once and used many times.
- DYNAMIC - The data store contents will be modified repeatedly and used many times.
The nature of access may be one of these:
- DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
- READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
- COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
- Parameters:
target
- the target buffer object. One of:data
- a pointer to data that will be copied into the data store for initialization, orNULL
if no data is to be copiedusage
- the expected usage pattern of the data store. One of:STREAM_DRAW_ARB
STREAM_READ_ARB
STREAM_COPY_ARB
STATIC_DRAW_ARB
STATIC_READ_ARB
STATIC_COPY_ARB
DYNAMIC_DRAW_ARB
DYNAMIC_READ_ARB
DYNAMIC_COPY_ARB
-
glBufferDataARB
Creates and initializes a buffer object's data store.usage
is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store.usage
can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The frequency of access may be one of these:- STREAM - The data store contents will be modified once and used at most a few times.
- STATIC - The data store contents will be modified once and used many times.
- DYNAMIC - The data store contents will be modified repeatedly and used many times.
The nature of access may be one of these:
- DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
- READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
- COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
- Parameters:
target
- the target buffer object. One of:data
- a pointer to data that will be copied into the data store for initialization, orNULL
if no data is to be copiedusage
- the expected usage pattern of the data store. One of:STREAM_DRAW_ARB
STREAM_READ_ARB
STREAM_COPY_ARB
STATIC_DRAW_ARB
STATIC_READ_ARB
STATIC_COPY_ARB
DYNAMIC_DRAW_ARB
DYNAMIC_READ_ARB
DYNAMIC_COPY_ARB
-
glBufferDataARB
Creates and initializes a buffer object's data store.usage
is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store.usage
can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The frequency of access may be one of these:- STREAM - The data store contents will be modified once and used at most a few times.
- STATIC - The data store contents will be modified once and used many times.
- DYNAMIC - The data store contents will be modified repeatedly and used many times.
The nature of access may be one of these:
- DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
- READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
- COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
- Parameters:
target
- the target buffer object. One of:data
- a pointer to data that will be copied into the data store for initialization, orNULL
if no data is to be copiedusage
- the expected usage pattern of the data store. One of:STREAM_DRAW_ARB
STREAM_READ_ARB
STREAM_COPY_ARB
STATIC_DRAW_ARB
STATIC_READ_ARB
STATIC_COPY_ARB
DYNAMIC_DRAW_ARB
DYNAMIC_READ_ARB
DYNAMIC_COPY_ARB
-
nglBufferSubDataARB
public static void nglBufferSubDataARB(int target, long offset, long size, long data) Unsafe version of:BufferSubDataARB
- Parameters:
size
- the size in bytes of the data store region being replaced
-
glBufferSubDataARB
Updates a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store where data replacement will begin, measured in bytesdata
- a pointer to the new data that will be copied into the data store
-
glBufferSubDataARB
Updates a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store where data replacement will begin, measured in bytesdata
- a pointer to the new data that will be copied into the data store
-
glBufferSubDataARB
Updates a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store where data replacement will begin, measured in bytesdata
- a pointer to the new data that will be copied into the data store
-
glBufferSubDataARB
Updates a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store where data replacement will begin, measured in bytesdata
- a pointer to the new data that will be copied into the data store
-
glBufferSubDataARB
Updates a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store where data replacement will begin, measured in bytesdata
- a pointer to the new data that will be copied into the data store
-
nglGetBufferSubDataARB
public static void nglGetBufferSubDataARB(int target, long offset, long size, long data) Unsafe version of:GetBufferSubDataARB
- Parameters:
size
- the size in bytes of the data store region being returned
-
glGetBufferSubDataARB
Returns a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store from which data will be returned, measured in bytesdata
- a pointer to the location where buffer object data is returned
-
glGetBufferSubDataARB
Returns a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store from which data will be returned, measured in bytesdata
- a pointer to the location where buffer object data is returned
-
glGetBufferSubDataARB
Returns a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store from which data will be returned, measured in bytesdata
- a pointer to the location where buffer object data is returned
-
glGetBufferSubDataARB
Returns a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store from which data will be returned, measured in bytesdata
- a pointer to the location where buffer object data is returned
-
glGetBufferSubDataARB
Returns a subset of a buffer object's data store.- Parameters:
target
- the target buffer object. One of:offset
- the offset into the buffer object's data store from which data will be returned, measured in bytesdata
- a pointer to the location where buffer object data is returned
-
nglMapBufferARB
public static long nglMapBufferARB(int target, int access) Unsafe version of:MapBufferARB
-
glMapBufferARB
Maps a buffer object's data store.LWJGL note: This method comes in 3 flavors:
glMapBufferARB(int, int)
- CallsGetBufferParameterivARB
to retrieve the buffer size and a new ByteBuffer instance is always returned.glMapBufferARB(int, int, ByteBuffer)
- CallsGetBufferParameterivARB
to retrieve the buffer size and theold_buffer
parameter is reused if not null.glMapBufferARB(int, int, long, ByteBuffer)
- The buffer size is explicitly specified and theold_buffer
parameter is reused if not null. This is the most efficient method.
- Parameters:
target
- the target buffer object being mapped. One of:access
- 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:READ_ONLY_ARB
WRITE_ONLY_ARB
READ_WRITE_ARB
-
glMapBufferARB
@Nullable public static ByteBuffer glMapBufferARB(int target, int access, @Nullable ByteBuffer old_buffer) Maps a buffer object's data store.LWJGL note: This method comes in 3 flavors:
glMapBufferARB(int, int)
- CallsGetBufferParameterivARB
to retrieve the buffer size and a new ByteBuffer instance is always returned.glMapBufferARB(int, int, ByteBuffer)
- CallsGetBufferParameterivARB
to retrieve the buffer size and theold_buffer
parameter is reused if not null.glMapBufferARB(int, int, long, ByteBuffer)
- The buffer size is explicitly specified and theold_buffer
parameter is reused if not null. This is the most efficient method.
- Parameters:
target
- the target buffer object being mapped. One of:access
- 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:READ_ONLY_ARB
WRITE_ONLY_ARB
READ_WRITE_ARB
-
glMapBufferARB
@Nullable public static ByteBuffer glMapBufferARB(int target, int access, long length, @Nullable ByteBuffer old_buffer) Maps a buffer object's data store.LWJGL note: This method comes in 3 flavors:
glMapBufferARB(int, int)
- CallsGetBufferParameterivARB
to retrieve the buffer size and a new ByteBuffer instance is always returned.glMapBufferARB(int, int, ByteBuffer)
- CallsGetBufferParameterivARB
to retrieve the buffer size and theold_buffer
parameter is reused if not null.glMapBufferARB(int, int, long, ByteBuffer)
- The buffer size is explicitly specified and theold_buffer
parameter is reused if not null. This is the most efficient method.
- Parameters:
target
- the target buffer object being mapped. One of:access
- 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:READ_ONLY_ARB
WRITE_ONLY_ARB
READ_WRITE_ARB
-
glUnmapBufferARB
public static boolean glUnmapBufferARB(int target) Relinquishes the mapping of a buffer object and invalidates the pointer to its data store.Returns TRUE unless data values in the buffer’s data store have become corrupted during the period that the buffer was mapped. Such corruption can be the result of a screen resolution change or other window system-dependent event that causes system heaps such as those for high-performance graphics memory to be discarded. GL implementations must guarantee that such corruption can occur only during the periods that a buffer’s data store is mapped. If such corruption has occurred, UnmapBuffer returns FALSE, and the contents of the buffer’s data store become undefined.
- Parameters:
target
- the target buffer object being unmapped. One of:
-
nglGetBufferParameterivARB
public static void nglGetBufferParameterivARB(int target, int pname, long params) Unsafe version of:GetBufferParameterivARB
-
glGetBufferParameterivARB
Returns the value of a buffer object parameter.- Parameters:
target
- the target buffer object. One of:pname
- the symbolic name of a buffer object parameter. One of:BUFFER_SIZE
BUFFER_USAGE
BUFFER_ACCESS
BUFFER_MAPPED
BUFFER_ACCESS_FLAGS
BUFFER_MAP_LENGTH
BUFFER_MAP_OFFSET
BUFFER_IMMUTABLE_STORAGE
BUFFER_STORAGE_FLAGS
params
- the requested parameter
-
glGetBufferParameteriARB
public static int glGetBufferParameteriARB(int target, int pname) Returns the value of a buffer object parameter.- Parameters:
target
- the target buffer object. One of:pname
- the symbolic name of a buffer object parameter. One of:BUFFER_SIZE
BUFFER_USAGE
BUFFER_ACCESS
BUFFER_MAPPED
BUFFER_ACCESS_FLAGS
BUFFER_MAP_LENGTH
BUFFER_MAP_OFFSET
BUFFER_IMMUTABLE_STORAGE
BUFFER_STORAGE_FLAGS
-
nglGetBufferPointervARB
public static void nglGetBufferPointervARB(int target, int pname, long params) Unsafe version of:GetBufferPointervARB
-
glGetBufferPointervARB
Returns the pointer to a mapped buffer object's data store.- Parameters:
target
- the target buffer object. One of:pname
- the pointer to be returned. Must be:BUFFER_MAP_POINTER_ARB
params
- the pointer value specified bypname
-
glGetBufferPointerARB
public static long glGetBufferPointerARB(int target, int pname) Returns the pointer to a mapped buffer object's data store.- Parameters:
target
- the target buffer object. One of:pname
- the pointer to be returned. Must be:BUFFER_MAP_POINTER_ARB
-
glDeleteBuffersARB
public static void glDeleteBuffersARB(int[] buffers) Array version of:DeleteBuffersARB
-
glGenBuffersARB
public static void glGenBuffersARB(int[] buffers) Array version of:GenBuffersARB
-
glBufferDataARB
public static void glBufferDataARB(int target, short[] data, int usage) Array version of:BufferDataARB
-
glBufferDataARB
public static void glBufferDataARB(int target, int[] data, int usage) Array version of:BufferDataARB
-
glBufferDataARB
public static void glBufferDataARB(int target, float[] data, int usage) Array version of:BufferDataARB
-
glBufferDataARB
public static void glBufferDataARB(int target, double[] data, int usage) Array version of:BufferDataARB
-
glBufferSubDataARB
public static void glBufferSubDataARB(int target, long offset, short[] data) Array version of:BufferSubDataARB
-
glBufferSubDataARB
public static void glBufferSubDataARB(int target, long offset, int[] data) Array version of:BufferSubDataARB
-
glBufferSubDataARB
public static void glBufferSubDataARB(int target, long offset, float[] data) Array version of:BufferSubDataARB
-
glBufferSubDataARB
public static void glBufferSubDataARB(int target, long offset, double[] data) Array version of:BufferSubDataARB
-
glGetBufferSubDataARB
public static void glGetBufferSubDataARB(int target, long offset, short[] data) Array version of:GetBufferSubDataARB
-
glGetBufferSubDataARB
public static void glGetBufferSubDataARB(int target, long offset, int[] data) Array version of:GetBufferSubDataARB
-
glGetBufferSubDataARB
public static void glGetBufferSubDataARB(int target, long offset, float[] data) Array version of:GetBufferSubDataARB
-
glGetBufferSubDataARB
public static void glGetBufferSubDataARB(int target, long offset, double[] data) Array version of:GetBufferSubDataARB
-
glGetBufferParameterivARB
public static void glGetBufferParameterivARB(int target, int pname, int[] params) Array version of:GetBufferParameterivARB
-