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

> ## Name

> cgGetProgramInput - get the program's input

> ## Synopsis

>     #include <Cg/cg.h>

>     CGenum cgGetProgramInput( CGprogram program );

> ## Parameters

> program
>   A program handle.

> ## Return Values

> Returns a program input enumerant. If the program is a vertex or fragment program, it returns CG_VERTEX or CG_FRAGMENT, respectively. For geometry programs the input is one of: CG_POINT, CG_LINE, CG_LINE_ADJ, CG_TRIANGLE, or CG_TRIANGLE_ADJ. For tessellation control and evaluation programs the input is CG_PATCH.

> Returns CG_UNKNOWN if the input is unknown.

> ## Description

> cgGetProgramInput returns the program input enumerant.

> ## Examples

>     void printProgramInput(CGprogram program)
>     {
>       char * input = NULL;
>       switch(cgGetProgramInput(program))
>       {
>         case CG_FRAGMENT:
>             input = "fragment";
>             break;
>         case CG_VERTEX:
>             input = "vertex";
>             break;
>         case CG_POINT:
>             input = "point";
>             break;
>         case CG_LINE:
>             input = "line";
>             break;
>         case CG_LINE_ADJ:
>             input = "line adjacency";
>             break;
>         case CG_TRIANGLE:
>             input = "triangle";
>             break;
>         case CG_TRIANGLE_ADJ:
>             input = "triangle adjacency";
>             break;
>         case CG_PATCH:
>             input = "patch";
>             break;
>         default:
>             input = "unknown";
>             break;
>       }
>       printf("Program inputs %s.\n", input);
>     }

> ## Errors

> CG_INVALID_PROGRAM_HANDLE_ERROR is generated if program is not valid program handle.

> ## History

> cgGetProgramInput was introduced in Cg 2.0.

> ## See Also

> cgGetProgramOutput