NAME

cgSetArraySize - sets the size of a resizable array parameter

SYNOPSIS

  #include <Cg/cg.h>

  void cgSetArraySize(CGparameter param, int size);

PARAMETERS

param

Specifies the array parameter handle.

size

Specifies the new size of the array.

DESCRIPTION

cgSetArraySize sets the size of a resiable array parameter param to size.

EXAMPLE

If you have Cg program with a parameter like this :

    // ...

    float4 main(float4 myarray[])
     {
      // ...
     }

You can set the size of the myarray array parameter to 5 like so :

    CGparameter MyArrayParam = 
     cgGetNamedProgramParameter(Program, CG_PROGRAM, "myarray");

    cgSetArraySize(MyArrayParam, 5);

RETURN VALUES

cgSetArraySize does not return any values.

ERRORS

CG_INVALID_PARAM_HANDLE_ERROR is generated if param is an invalid parameter handle or not an array.

CG_ARRAY_PARAM_ERROR if param is not an array param.

CG_INVALID_DIMENSION_ERROR is generated if the dimension of the array parameter param is not 1.

CG_PARAMETER_IS_NOT_RESIZABLE_ARRAY_ERROR is generated if param is not a resizable array.

SEE ALSO

the "cgGetArraySize" document, the "cgGetArrayDimension" document, and the "cgSetMultiDimArraySize" document