NAME

cgSetBufferSubData - partially update a Cg buffer object

SYNOPSIS

  #include <Cg/cg.h>

  void cgSetBufferSubData( CGbuffer buffer,
                           int offset,
                           int size,
                           const void * data );

PARAMETERS

buffer

The buffer which will be updated.

offset

The offset in bytes within the buffer where the partial update begins.

size

Specifies a new size for the buffer object. Zero means no bytes are updated.

data

Pointer to the data to copy into the buffer. The number of bytes to copy is determined by the size parameter.

RETURN VALUES

None.

DESCRIPTION

cgSetBufferSubData resizes and partially updates an existing buffer object.

A buffer which has been mapped into an applications address space with cgMapBuffer must be unmapped using cgUnmapBuffer before it can be updated with cgSetBufferSubData.

EXAMPLES

cgSetBufferSubData( myBuffer, 16, sizeof( myData ), myData );

ERRORS

CG_INVALID_BUFFER_HANDLE_ERROR is generated if buffer is not a valid buffer.

CG_BUFFER_UPDATE_NOT_ALLOWED_ERROR is generated if buffer is currently mapped.

HISTORY

cgSetBufferSubData was introduced in Cg 2.0.

SEE ALSO

cgCreateBuffer, cgGLCreateBuffer, cgSetBufferData, cgMapBuffer, cgUnmapBuffer