Name
cgGetArrayParameter - get a parameter from an array
Synopsis
#include <Cg/cg.h>
CGparameter cgGetArrayParameter( CGparameter param,
int index );
Parameters
- param
-
The array parameter handle.
- index
-
The index into the array.
Return Values
Returns the parameter at the specified index of param if param
references an array, and the index is valid.
Returns NULL otherwise.
Description
cgGetArrayParameter returns the parameter of array param specified
by index. cgGetArrayParameter is used when inspecting elements of an
array parameter in a program.
Examples
CGparameter array = ...; /* some array parameter */
int array_size = cgGetArraySize( array );
for(i=0; i < array_size; ++i)
{
CGparameter element = cgGetArrayParameter(array, i);
/* Do stuff with element */
}
Errors
CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter.
CG_ARRAY_PARAM_ERROR is generated if param is not an array parameter.
CG_OUT_OF_ARRAY_BOUNDS_ERROR is generated if index is outside the
bounds of param.
History
cgGetArrayParameter was introduced in Cg 1.1.
See Also
cgGetArrayDimension,
cgGetArraySize,
cgGetParameterType
|