> ## Name

> cgDestroyParameter - destroy a parameter

> ## Synopsis

>     #include <Cg/cg.h>

>     void cgDestroyParameter( CGparameter param );

> ## Parameters

> param
>   The parameter to destroy.

> ## Return Values

> None.

> ## Description

> cgDestroyParameter destroys parameters created with cgCreateParameter, cgCreateParameterArray, or cgCreateParameterMultiDimArray.

> Upon destruction, param will become invalid. Any connections (see cgConnectParameter) in which param is the destination parameter will be disconnected. An error will be thrown if param is a source parameter in any connections.

> The parameter being destroyed may not be one of the children parameters of a struct or array parameter. In other words it must be a CGparameter returned by one of the cgCreateParameter family of entry points.

> ## Examples

>     CGcontext context = cgCreateContext();
>     CGparameter floatParam = cgCreateParameter(context, CG_FLOAT);
>     CGparameter floatParamArray = cgCreateParameterArray(context, CG_FLOAT, 5);

>     /* ... */

>     cgDestroyParameter(floatParam);
>     cgDestroyParameter(floatParamArray);

> ## Errors

> CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter.

> CG_NOT_ROOT_PARAMETER_ERROR is generated if the param isn't the top-level parameter of a struct or array that was created.

> CG_PARAMETER_IS_NOT_SHARED_ERROR is generated if param does not refer to a parameter created by one of the cgCreateParameter family of entry points.

> CG_CANNOT_DESTROY_PARAMETER_ERROR is generated if param is a source parameter in a connection made by cgConnectParameter. cgDisconnectParameter should be used before calling cgDestroyParameter in such a case.

> ## History

> cgDestroyParameter was introduced in Cg 1.2.

> ## See Also

> cgCreateParameter, cgCreateParameterArray, cgCreateParameterMultiDimArray