Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class ARBVertexBufferObject

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Native bindings to the ARB_vertex_buffer_object extension.

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 TypeField and Description
public static final int
GL_ARRAY_BUFFER_ARB

Accepted by the target parameters of BindBufferARB, BufferDataARB, BufferSubDataARB, MapBufferARB, UnmapBufferARB, GetBufferSubDataARB, GetBufferParameterivARB, and GetBufferPointervARB.

public static final int
GL_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_BUFFER_ACCESS_ARB

Accepted by the pname parameter of GetBufferParameterivARB.

public static final int
GL_BUFFER_MAP_POINTER_ARB

Accepted by the pname parameter of GetBufferPointervARB.

public static final int
GL_BUFFER_MAPPED_ARB

Accepted by the pname parameter of GetBufferParameterivARB.

public static final int
GL_BUFFER_SIZE_ARB

Accepted by the pname parameter of GetBufferParameterivARB.

public static final int
GL_BUFFER_USAGE_ARB

Accepted by the pname parameter of GetBufferParameterivARB.

public static final int
GL_COLOR_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_DYNAMIC_COPY_ARB

Accepted by the usage parameter of BufferDataARB.

public static final int
GL_DYNAMIC_DRAW_ARB

Accepted by the usage parameter of BufferDataARB.

public static final int
GL_DYNAMIC_READ_ARB

Accepted by the usage parameter of BufferDataARB.

public static final int
GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_ELEMENT_ARRAY_BUFFER_ARB

Accepted by the target parameters of BindBufferARB, BufferDataARB, BufferSubDataARB, MapBufferARB, UnmapBufferARB, GetBufferSubDataARB, GetBufferParameterivARB, and GetBufferPointervARB.

public static final int
GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_INDEX_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_NORMAL_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_READ_ONLY_ARB

Accepted by the access parameter of MapBufferARB.

public static final int
GL_READ_WRITE_ARB

Accepted by the access parameter of MapBufferARB.

public static final int
GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_STATIC_COPY_ARB

Accepted by the usage parameter of BufferDataARB.

public static final int
GL_STATIC_DRAW_ARB

Accepted by the usage parameter of BufferDataARB.

public static final int
GL_STATIC_READ_ARB

Accepted by the usage parameter of BufferDataARB.

public static final int
GL_STREAM_COPY_ARB

Accepted by the usage parameter of BufferDataARB.

public static final int
GL_STREAM_DRAW_ARB

Accepted by the usage parameter of BufferDataARB.

public static final int
GL_STREAM_READ_ARB

Accepted by the usage parameter of BufferDataARB.

public static final int
GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_VERTEX_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetVertexAttribivARB.

public static final int
GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

public static final int
GL_WRITE_ONLY_ARB

Accepted by the access parameter of MapBufferARB.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static native void
public static void
public static void
glBufferDataARB(int target, ByteBuffer
a pointer to data that will be copied into the data store for initialization, or NULL if no data is to be copied
data
,
int usage)

Creates and initializes a buffer object's data store.

public static void
public static void
glBufferDataARB(int target, IntBuffer
a pointer to data that will be copied into the data store for initialization, or NULL if no data is to be copied
data
,
int usage)

Creates and initializes a buffer object's data store.

public static void
public static void
public static void
glBufferDataARB(int target, short[] data, int usage)

Array version of: BufferDataARB

public static void
glBufferDataARB(int target, int[] data, int usage)

Array version of: BufferDataARB

public static void
glBufferDataARB(int target, float[] data, int usage)

Array version of: BufferDataARB

public static void
glBufferDataARB(int target, double[] data, int usage)

Array version of: BufferDataARB

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
glBufferSubDataARB(int target, long offset, short[] data)

Array version of: BufferSubDataARB

public static void
glBufferSubDataARB(int target, long offset, int[] data)

Array version of: BufferSubDataARB

public static void
glBufferSubDataARB(int target, long offset, float[] data)

Array version of: BufferSubDataARB

public static void
glBufferSubDataARB(int target, long offset, double[] data)

Array version of: BufferSubDataARB

public static void
glDeleteBuffersARB(IntBuffer
an array of buffer objects to be deleted
buffers
)

Deletes named buffer objects.

public static void
glDeleteBuffersARB(int buffer)

Deletes named buffer objects.

public static void
glDeleteBuffersARB(int[] buffers)

Array version of: DeleteBuffersARB

public static void
glGenBuffersARB(IntBuffer
a buffer in which the generated buffer object names are stored
buffers
)

Generates buffer object names.

public static int
glGenBuffersARB()

Generates buffer object names.

public static void
glGenBuffersARB(int[] buffers)

Array version of: GenBuffersARB

public static int
public static void
public static void
glGetBufferParameterivARB(int target, int pname, int[] params)

Array version of: GetBufferParameterivARB

public static long
public static void
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
glGetBufferSubDataARB(int target, long offset, short[] data)

Array version of: GetBufferSubDataARB

public static void
glGetBufferSubDataARB(int target, long offset, int[] data)

Array version of: GetBufferSubDataARB

public static void
glGetBufferSubDataARB(int target, long offset, float[] data)

Array version of: GetBufferSubDataARB

public static void
glGetBufferSubDataARB(int target, long offset, double[] data)

Array version of: GetBufferSubDataARB

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 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:
READ_ONLY_ARBWRITE_ONLY_ARBREAD_WRITE_ARB
access
)

Maps a buffer object's data store.

public static ByteBuffer
glMapBufferARB(int 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:
READ_ONLY_ARBWRITE_ONLY_ARBREAD_WRITE_ARB
access
,
ByteBuffer old_buffer)

Maps a buffer object's data store.

public static ByteBuffer
glMapBufferARB(int 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:
READ_ONLY_ARBWRITE_ONLY_ARBREAD_WRITE_ARB
access
,
long length, ByteBuffer old_buffer)

Maps a buffer object's data store.

public static native boolean
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: BufferDataARB

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: BufferSubDataARB

public static native void
nglDeleteBuffersARB(int
the number of buffer objects to be deleted
n
,
long buffers)

Unsafe version of: DeleteBuffersARB

public static native void
nglGenBuffersARB(int
the number of buffer object names to be generated
n
,
long buffers)

Unsafe version of: GenBuffersARB

public static native void
nglGetBufferParameterivARB(int target, int pname, long params)

Unsafe version of: GetBufferParameterivARB

public static native void
nglGetBufferPointervARB(int target, int pname, long params)

Unsafe version of: GetBufferPointervARB

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: GetBufferSubDataARB

public static native long
nglMapBufferARB(int target, int access)

Unsafe version of: MapBufferARB

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait