cgGetNextProgram

> # NAME

> cgGetNextProgram - iterate through programs in a context

> # SYNOPSIS

>       #include <Cg/cg.h>

>       CGprogram cgGetNextProgram( CGprogram program );

> # PARAMETERS

> program

>   The current program.

> # RETURN VALUES

> Returns the next program in the context's internal sequence of programs.

> Returns NULL when program is the last program in the context.

> # DESCRIPTION

> The programs within a context can be iterated over by using cgGetNextProgram.

> Note that no specific order of traversal is defined by this mechanism. The only guarantee is that each program will be visited exactly once. No guarantees can be made if programs are generated or deleted during iteration.

> # EXAMPLES

>       CGprogram program = cgGetFirstProgram( context );
>       while( program )
>       {
>         /* do something with program */
>         program = cgGetNextProgram( program )
>       }

> # ERRORS

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

> # HISTORY

> cgGetNextProgram was introduced in Cg 1.1.

> # SEE ALSO

> cgGetFirstProgram, cgCreateProgram, cgDestroyProgram, cgIsProgram