GLBINDBUFFER(3gl)GLBINDBUFFER(3gl)NAMEglBindBuffer - bind a named buffer to a buffering target
C SPECIFICATION
void glBindBuffer( GLenum target,
GLuint buffer )
PARAMETERS
target Specifies the target to which the buffer is bound. Must be
either GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER.
buffer Specifies the name of a buffer.
DESCRIPTIONglBindBuffer lets you create or use a named buffer. Calling glBind‐
Buffer with target set to GL_ARRAY_BUFFER, or GL_ELEMENT_ARRAY_BUFFER
and buffer set to the name of the new buffer binds the buffer name to
the target. When a buffer is bound to a target, the previous binding
for that target is automatically broken.
Buffer names are unsigned integers. The value zero is reserved to rep‐
resent the default buffer for each buffer object. Buffer names and the
corresponding buffer contents are local to the shared display-list
space (see glXCreateContext) of the current GL rendering context; two
rendering contexts share buffer names only if they also share display
lists.
You may use glGenBuffers to generate a set of new buffer names.
While a buffer is bound, GL operations on the target to which it is
bound affect the bound buffer, and queries of the target to which it is
bound return state from the bound buffer. In effect, the buffer tar‐
gets become aliases for the buffer currently bound to them, and the
buffer name zero refers to the default buffers that were bound to them
at initialization.
A buffer binding created with glBindBuffer remains active until a dif‐
ferent buffer is bound to the same target, or until the bound buffer is
deleted with glDeleteBuffers. Once created, a named buffer may be re-
bound to the target of as often as needed.
glBindBuffer is included in display lists.
NOTESglBindBuffer is available only if the GL version is 1.5 or greater.
ERRORS
GL_INVALID_ENUM is generated if target is not one of the allowable val‐
ues.
GL_INVALID_OPERATION is generated if glBindBuffer is executed between
the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GL_ARRAY_BUFFER_BINDING
glGet with argument GL_ELEMENT_ARRAY_BUFFER_BINDING
glGet with argument GL_VERTEX_ARRAY_BUFFER_BINDING
glGet with argument GL_NORMAL_ARRAY_BUFFER_BINDING
glGet with argument GL_COLOR_ARRAY_BUFFER_BINDING
glGet with argument GL_INDEX_ARRAY_BUFFER_BINDING
glGet with argument GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING
glGet with argument GL_EDGE_FLAG_ARRAY_BUFFER_BINDING
glGet with argument GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING
glGet with argument GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
glGet with argument GL_WEIGHT_ARRAY_BUFFER_BINDING
SEE ALSO
glDeleteBuffers, glGenBuffers, glGet,
glIsBuffer, glGetBufferSubData, glGetBufferParameter, glGetBuffer‐
Pointer
13 Jan 04 GLBINDBUFFER(3gl)