> ## Name

> cgGetUserType - get enumerant of user-defined type from a program or effect

> ## Synopsis

>     #include <Cg/cg.h>

>     CGtype cgGetUserType( CGhandle handle,
>                           int index );

> ## Parameters

> handle
>   The CGprogram or CGeffect in which the type is defined.
> index
>   The index of the user-defined type. index must be greater than or equal to 0 and less than the value returned by cgGetNumUserTypes.

> ## Return Values

> Returns the type enumerant associated with the type with the given index.

> ## Description

> cgGetUserType returns the enumerant associated with the user-defined type with the given index in the given CGprogram or CGeffect.

> ## Examples

> to-be-written

> ## Errors

> CG_INVALID_PROGRAM_HANDLE_ERROR is generated if handle is not a valid program or effect handle.

> CG_OUT_OF_ARRAY_BOUNDS_ERROR is generated if index is outside the proper range.

> ## History

> cgGetUserType was introduced in Cg 1.2.

> ## See Also

> cgGetNumUserTypes, cgGetNamedUserType