cgCreateParameterMultiDimArray
Keywords: cgCreateParameterMultiDimArray, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## Name

> cgCreateParameterMultiDimArray - creates a multi-dimensional parameter array

> ## Synopsis

>     #include <Cg/cg.h>

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

> ## Parameters

> context
>   The context to which the new parameter will be added.
> type
>   The type of the new parameter.
> dim
>   The dimension of the multi-dimensional array.
> lengths
>   An array of length values, one for each dimension of the array to be created.

> ## Return Values

> Returns the handle to the new parameter array.

> ## Description

> cgCreateParameterMultiDimArray 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 cgCreateParameterArray. 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.

> ## Examples

>     /* Creates a three dimensional float array similar to */
>     /* the C declaration :  float param[5][3][4]; */

>     int lengths[] = { 5, 3, 4 };
>     CGcontext context = cgCreateContext();
>     CGparameter param = cgCreateParameterMultiDimArray(context, CG_FLOAT,
>                                                        3, lengths);

> ## Errors

> CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.

> CG_INVALID_VALUE_TYPE_ERROR is generated if type is invalid.

> ## History

> cgCreateParameterMultiDimArray was introduced in Cg 1.2.

> ## See Also

> cgCreateParameter, cgCreateParameterArray, cgDestroyParameter, cgConnectParameter