> # NAME

> cgGetProgramOutput - get the program's output

> # SYNOPSIS

>       #include <Cg/cg.h>

>       CGenum cgGetProgramOutput( CGprogram program );

> # PARAMETERS

> program

>   A program handle.

> # RETURN VALUES

> Returns a program output enumerant. If the program is a vertex or fragment program, it returns CG_VERTEX or CG_FRAGMENT, respectively. For geometry programs the output is one of: CG_POINT_OUT, CG_LINE_OUT, or CG_TRIANGLE_OUT. For tessellation control programs the output is CG_PATCH.

> Returns CG_UNKNOWN if the output is unknown.

> # DESCRIPTION

> cgGetProgramOutput returns the program output enumerant.

> For geometry programs, an input must be specified but not an output because of implicit output defaults. For example, if either "TRIANGLE" or "TRIANGLE_ADJ" is specified as an input without an explicit output in the shader source, then cgGetProgramOutput will return CG_TRIANGLE_OUT.

> # EXAMPLES

>       void printProgramOutput(CGprogram program)
>       {
>         char * output = NULL;
>         switch(cgGetProgramOutput(program))
>         {
>           case CG_VERTEX:
>               output = "vertex";
>               break;
>           case CG_FRAGMENT:
>               output = "fragment";
>               break;
>           case CG_POINT_OUT:
>               output = "point";
>               break;
>           case CG_LINE_OUT:
>               output = "line";
>               break;
>           case CG_TRIANGLE_OUT:
>               output = "triangle";
>               break;
>           case CG_PATCH:
>               output = "patch";
>               break;
>           default:
>               output = "unknown";
>               break;
>         }
>         printf("Program outputs %s.\n", output);
>       }

> # ERRORS

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

> # HISTORY

> cgGetProgramOutput was introduced in Cg 2.0.

> # SEE ALSO

> cgGetProgramInput