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