'\" t .\" Title: glBindBuffer .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 03/08/2011 .\" Manual: OpenGL 3.3 .\" Source: OpenGL 3.3 .\" Language: English .\" .TH "GLBINDBUFFER" "3G" "03/08/2011" "OpenGL 3.3" "OpenGL 3\&.3" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" glBindBuffer \- bind a named buffer object .SH "C SPECIFICATION" .HP \w'void\ glBindBuffer('u .BI "void glBindBuffer(GLenum\ " "target" ", GLuint\ " "buffer" ");" .SH "PARAMETERS" .PP \fItarget\fR .RS 4 Specifies the target to which the buffer object is bound\&. The symbolic constant must be \fBGL_ARRAY_BUFFER\fR, \fBGL_COPY_READ_BUFFER\fR, \fBGL_COPY_WRITE_BUFFER\fR, \fBGL_ELEMENT_ARRAY_BUFFER\fR, \fBGL_PIXEL_PACK_BUFFER\fR, \fBGL_PIXEL_UNPACK_BUFFER\fR, \fBGL_TEXTURE_BUFFER\fR, \fBGL_TRANSFORM_FEEDBACK_BUFFER\fR, or \fBGL_UNIFORM_BUFFER\fR\&. .RE .PP \fIbuffer\fR .RS 4 Specifies the name of a buffer object\&. .RE .SH "DESCRIPTION" .PP \fBglBindBuffer\fR binds a buffer object to the specified buffer binding point\&. Calling \fBglBindBuffer\fR with \fItarget\fR set to one of the accepted symbolic constants and \fIbuffer\fR set to the name of a buffer object binds that buffer object name to the target\&. If no buffer object with name \fIbuffer\fR exists, one is created with that name\&. When a buffer object is bound to a target, the previous binding for that target is automatically broken\&. .PP Buffer object names are unsigned integers\&. The value zero is reserved, but there is no default buffer object for each buffer object target\&. Instead, \fIbuffer\fR set to zero effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target (if supported for that target)\&. Buffer object names and the corresponding buffer object contents are local to the shared object space of the current GL rendering context; two rendering contexts share buffer object names only if they explicitly enable sharing between contexts through the appropriate GL windows interfaces functions\&. .PP \fBglGenBuffers\fR() must be used to generate a set of unused buffer object names\&. .PP The state of a buffer object immediately after it is first bound is an unmapped zero\-sized memory buffer with \fBGL_READ_WRITE\fR access and \fBGL_STATIC_DRAW\fR usage\&. .PP While a non\-zero buffer object name is bound, GL operations on the target to which it is bound affect the bound buffer object, and queries of the target to which it is bound return state from the bound buffer object\&. While buffer object name zero is bound, as in the initial state, attempts to modify or query state on the target to which it is bound generates an \fBGL_INVALID_OPERATION\fR error\&. .PP When a non\-zero buffer object is bound to the \fBGL_ARRAY_BUFFER\fR target, the vertex array pointer parameter is interpreted as an offset within the buffer object measured in basic machine units\&. .PP While a non\-zero buffer object is bound to the \fBGL_ELEMENT_ARRAY_BUFFER\fR target, the indices parameter of \fBglDrawElements\fR(), \fBglDrawElementsInstanced\fR(), \fBglDrawElementsBaseVertex\fR(), \fBglDrawRangeElements\fR(), \fBglDrawRangeElementsBaseVertex\fR(), \fBglMultiDrawElements\fR(), or \fBglMultiDrawElementsBaseVertex\fR() is interpreted as an offset within the buffer object measured in basic machine units\&. .PP While a non\-zero buffer object is bound to the \fBGL_PIXEL_PACK_BUFFER\fR target, the following commands are affected: \fBglGetCompressedTexImage\fR(), \fBglGetTexImage\fR(), and \fBglReadPixels\fR()\&. The pointer parameter is interpreted as an offset within the buffer object measured in basic machine units\&. .PP While a non\-zero buffer object is bound to the \fBGL_PIXEL_UNPACK_BUFFER\fR target, the following commands are affected: \fBglCompressedTexImage1D\fR(), \fBglCompressedTexImage2D\fR(), \fBglCompressedTexImage3D\fR(), \fBglCompressedTexSubImage1D\fR(), \fBglCompressedTexSubImage2D\fR(), \fBglCompressedTexSubImage3D\fR(), \fBglTexImage1D\fR(), \fBglTexImage2D\fR(), \fBglTexImage3D\fR(), \fBglTexSubImage1D\fR(), \fBglTexSubImage2D\fR(), and \fBglTexSubImage3D\fR()\&. The pointer parameter is interpreted as an offset within the buffer object measured in basic machine units\&. .PP The buffer targets \fBGL_COPY_READ_BUFFER\fR and \fBGL_COPY_WRITE_BUFFER\fR are provided to allow \fBglCopyBufferSubData\fR() to be used without disturbing the state of other bindings\&. However, \fBglCopyBufferSubData\fR() may be used with any pair of buffer binding points\&. .PP The \fBGL_TRANSFORM_FEEDBACK_BUFFER\fR buffer binding point may be passed to \fBglBindBuffer\fR, but will not directly affect transform feedback state\&. Instead, the indexed \fBGL_TRANSFORM_FEEDBACK_BUFFER\fR bindings must be used through a call to \fBglBindBufferBase\fR() or \fBglBindBufferRange\fR()\&. This will affect the generic \fBGL_TRANSFORM_FEEDABCK_BUFFER\fR binding\&. .PP Likewise, the \fBGL_UNIFORM_BUFFER\fR buffer binding point may be used, but does not directly affect uniform buffer state\&. \fBglBindBufferBase\fR() or \fBglBindBufferRange\fR() must be used to bind a buffer to an indexed uniform buffer binding point\&. .PP A buffer object binding created with \fBglBindBuffer\fR remains active until a different buffer object name is bound to the same target, or until the bound buffer object is deleted with \fBglDeleteBuffers\fR()\&. .PP Once created, a named buffer object may be re\-bound to any target as often as needed\&. However, the GL implementation may make choices about how to optimize the storage of a buffer object based on its initial binding target\&. .SH "NOTES" .PP The \fBGL_COPY_READ_BUFFER\fR, \fBGL_UNIFORM_BUFFER\fR and \fBGL_TEXTURE_BUFFER\fR targets are available only if the GL version is 3\&.1 or greater\&. .SH "ERRORS" .PP \fBGL_INVALID_ENUM\fR is generated if \fItarget\fR is not one of the allowable values\&. .PP \fBGL_INVALID_VALUE\fR is generated if \fIbuffer\fR is not a name previously returned from a call to \fBglGenBuffers\fR()\&. .SH "ASSOCIATED GETS" .PP \fBglGet\fR() with argument \fBGL_ARRAY_BUFFER_BINDING\fR .PP \fBglGet\fR() with argument \fBGL_COPY_READ_BUFFER_BINDING\fR .PP \fBglGet\fR() with argument \fBGL_COPY_WRITE_BUFFER_BINDING\fR .PP \fBglGet\fR() with argument \fBGL_ELEMENT_ARRAY_BUFFER_BINDING\fR .PP \fBglGet\fR() with argument \fBGL_PIXEL_PACK_BUFFER_BINDING\fR .PP \fBglGet\fR() with argument \fBGL_PIXEL_UNPACK_BUFFER_BINDING\fR .PP \fBglGet\fR() with argument \fBGL_TRANSFORM_FEEDBACK_BUFFER_BINDING\fR .PP \fBglGet\fR() with argument \fBGL_UNIFORM_BUFFER_BINDING\fR .SH "SEE ALSO" .PP \fBglGenBuffers\fR(), \fBglBindBufferBase\fR(), \fBglBindBufferRange\fR(), \fBglMapBuffer\fR(), \fBglUnmapBuffer\fR(), \fBglDeleteBuffers\fR(), \fBglGet\fR(), \fBglIsBuffer\fR() .SH "COPYRIGHT" .PP Copyright \(co 2005 Addison\-Wesley\&. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1\&.0, 8 June 1999\&. \m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&.