> # NAME

> cgGetProgramBuffer - get buffer associated with a buffer index

> # SYNOPSIS

>       #include <Cg/cg.h>

>       CGbuffer cgGetProgramBuffer( CGprogram program,
>                                    int bufferIndex );

> # PARAMETERS

> program

>   The program from which the associated buffer will be retrieved.

> bufferIndex

>   The buffer index for which the associated buffer will be retrieved.

> # RETURN VALUES

> Returns a buffer handle on success.

> Returns NULL if an error occurs.

> # DESCRIPTION

> cgGetProgramBuffer returns the buffer handle associated with a given buffer index from program. The returned value can be NULL if no buffer is associated with this index or if an error occurs.

> # EXAMPLES

> CGbuffer myBuffer = cgGetProgramBuffer( myProgram, 0 );

> # ERRORS

> CG_INVALID_PROGRAM_HANDLE_ERROR is generated if program is not a valid program handle.

> CG_BUFFER_INDEX_OUT_OF_RANGE_ERROR is generated if bufferIndex is not within the valid range of buffer indices for program.

> # HISTORY

> cgGetProgramBuffer was introduced in Cg 2.0.

> # SEE ALSO

> cgSetProgramBuffer, cgGetParameterBufferIndex, cgCreateBuffer