Name

cgGetParameterBufferIndex - get buffer index by parameter

Synopsis

#include <Cg/cg.h>

int cgGetParameterBufferIndex( CGparameter param );

Parameters

param
The parameter for which the associated buffer index will be retrieved.

Return Values

Returns the index for the buffer to which param belongs.

Returns -1 if param does not belong to a buffer or an error occurs.

Description

cgGetParameterBufferIndex returns the index for the buffer to which a parameter belongs. If param does not belong to a buffer, then -1 is returned.

If the program to which param belongs is in an uncompiled state, it will be compiled by cgGetParameterBufferIndex. See cgSetAutoCompile for more information about program compile states.

Examples

  int index = cgGetParameterBufferIndex( myParam );

Errors

CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter.

History

cgGetParameterBufferIndex was introduced in Cg 2.0.

See Also

cgSetProgramBuffer, cgGetParameterBufferOffset, cgGetParameterResourceSize, cgSetAutoCompile