'\" t .\" Title: glBufferSubData .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 05/30/2012 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "GLBUFFERSUBDATA" "3G" "05/30/2012" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * 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" glBufferSubData \- updates a subset of a buffer object\*(Aqs data store .SH "C SPECIFICATION" .HP \w'void\ glBufferSubData('u .BI "void glBufferSubData(GLenum\ " "target" ", GLintptr\ " "offset" ", GLsizeiptr\ " "size" ", const\ GLvoid\ *\ " "data" ");" .SH "PARAMETERS" .PP \fItarget\fR .RS 4 Specifies the target buffer object\&. 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 \fIoffset\fR .RS 4 Specifies the offset into the buffer object\*(Aqs data store where data replacement will begin, measured in bytes\&. .RE .PP \fIsize\fR .RS 4 Specifies the size in bytes of the data store region being replaced\&. .RE .PP \fIdata\fR .RS 4 Specifies a pointer to the new data that will be copied into the data store\&. .RE .SH "DESCRIPTION" .PP \fBglBufferSubData\fR redefines some or all of the data store for the buffer object currently bound to \fItarget\fR\&. Data starting at byte offset \fIoffset\fR and extending for \fIsize\fR bytes is copied to the data store from the memory pointed to by \fIdata\fR\&. An error is thrown if \fIoffset\fR and \fIsize\fR together define a range beyond the bounds of the buffer object\*(Aqs data store\&. .SH "NOTES" .PP When replacing the entire data store, consider using \fBglBufferSubData\fR rather than completely recreating the data store with \fBglBufferData\fR\&. This avoids the cost of reallocating the data store\&. .PP Consider using multiple buffer objects to avoid stalling the rendering pipeline during data store updates\&. If any rendering in the pipeline makes reference to data in the buffer object being updated by \fBglBufferSubData\fR, especially from the specific region being updated, that rendering must drain from the pipeline before the data store can be updated\&. .PP Clients must align data elements consistent with the requirements of the client platform, with an additional base\-level requirement that an offset within a buffer to a datum comprising N bytes be a multiple of N\&. .SH "ERRORS" .PP \fBGL_INVALID_ENUM\fR is generated if \fItarget\fR is not one of the accepted buffer targets\&. .PP \fBGL_INVALID_VALUE\fR is generated if \fIoffset\fR or \fIsize\fR is negative, or if together they define a region of memory that extends beyond the buffer object\*(Aqs allocated data store\&. .PP \fBGL_INVALID_OPERATION\fR is generated if the reserved buffer object name 0 is bound to \fItarget\fR\&. .PP \fBGL_INVALID_OPERATION\fR is generated if the buffer object being updated is mapped\&. .SH "ASSOCIATED GETS" .PP \fBglGetBufferSubData\fR() .SH "SEE ALSO" .PP \fBglBindBuffer\fR(), \fBglBufferData\fR(), \fBglMapBuffer\fR(), \fBglUnmapBuffer\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[]\&.