cgGetBufferSize
Keywords: cgGetBufferSize, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## Name

> cgGetBufferSize - get the size of a buffer

> ## Synopsis

>     #include <Cg/cg.h>

>     int cgGetBufferSize( CGbuffer buffer );

> ## Parameters

> buffer
>   The buffer for which the size will be retrieved.

> ## Return Values

> Returns the size in bytes of buffer.

> Returns -1 if an error occurs.

> ## Description

> cgGetBufferSize returns the size in bytes of buffer.

> ## Examples

> int size = cgGetBufferSize( myBuffer );

> ## Errors

> CG_INVALID_BUFFER_HANDLE_ERROR is generated if buffer is not a valid buffer.

> ## History

> cgGetBufferSize was introduced in Cg 2.0.

> ## See Also

> cgCreateBuffer, cgGLCreateBuffer, cgSetBufferData, cgSetBufferSubData