NAME

cgCreateParameterMultiDimArray - creates a multi-dimensional parameter array

SYNOPSIS

  #include <Cg/cg.h>

  CGparameter cgCreateParameterMultiDimArray(CGcontext ctx,
                                             CGtype type,
                                             int dim, 
                                             const int *lengths);

PARAMETERS

ctx

Specifies the context that the new parameter will be added to.

type

The type of the new parameter.

dim

The dimension of the multi-dimensional array.

lengths

An array of length values, one length per dimension.

DESCRIPTION

cgCreateParameterMultiArray creates context level shared multi-dimensional parameter arrays. These parameters are primarily used by connecting them to one or more program parameter arrays with cgConnectParameter.

cgCreateParameterMultiDimArray works similarly to cgCreateParameterMultiDimArray. Instead of taking a single length parameter it takes an array of lengths, one per dimension. The dimension of the array is defined by the dim parameter.

RETURN VALUES

Returns the handle to the new parameter array.

EXAMPLES

  // Creates a three dimensional float array similar to the C declaration :
  //  float MyFloatArray[5][3][4];
  int Lengths[] = { 5, 3, 4 }; 
  CGcontext Context = cgCreateContext();
  CGparameter MyFloatArray = 
    cgCreateParameterArray(Context, CG_FLOAT, 3, Lengths);

ERRORS

CG_INVALID_VALUE_TYPE_ERROR is generated if type is invalid.

CG_INVALID_CONTEXT_HANDLE_ERROR if ctx is invalid.

SEE ALSO

the "cgCreateParameter" document, the "cgCreateParameterArray" document, and the "cgDestroyParameter" document