Name

glBufferSubData - modifies some or all of the data contained in a buffer object's data store.

C Specification

void glBufferSubData(GLenum target,
    GLintptr offset,
    GLsizeiptr size,
    const GLvoid * data)

Parameters

target

Specifies the buffer object target. Must be GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER.

offset

Specifies the starting offset of the data to be replaced in basic machine units.

size

Specifies the size of the data to be replaced in basic machine units.

data

Specifies a region of client memory size basic machine units in length, containing the data that replace the specified buffer range.

Description

glBufferSubData lets you modify some or all of the data contained in a buffer object's data store.

Notes

glBufferData and glBufferSubData define two new types that will work well on 64-bit systems, analogous to C’s ”intptr t”. The new type ”GLintptrARB” should be used in place of GLint whenever it is expected that values might exceed 2 billion. The new type ”GLsizeiptrARB” should be used in place of GLsizei whenever it is expected that counts might exceed 2 billion. Both types are defined as signed integers large enough to contain any pointer value. As a result, they naturally scale to larger numbers of bits on systems with 64-bit or even larger pointers.

Errors

GL_INVALID_ENUM is generated if target is not one of the allowable values.

GL_INVALID_VALUE is generated if offset or size is less than zero, or if offset + size is greater than the value of BUFFER_SIZE.

Copyright

Copyright © 2003-2004 Silicon Graphics, Inc.

This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.

See Also

glBufferData, glBindBuffer, glDeleteBuffers, glGenBuffers