Name
cgGetFirstProgram - get the first program in a context
Synopsis
#include <Cg/cg.h>
CGprogram cgGetFirstProgram( CGcontext context );
Parameters
- context
-
The context from which to retrieve the first program.
Return Values
Returns the first CGprogram object in context.
Returns NULL if context contains no programs or an error occurs.
Description
cgGetFirstProgram is used to begin iteration over all of the
programs contained within a context. See cgGetNextProgram for
more information.
Examples
CGprogram program = cgGetFirstProgram( context );
while ( program )
{
/* do something with program */
program = cgGetNextProgram( program );
}
Errors
CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.
History
cgGetFirstProgram was introduced in Cg 1.1.
See Also
cgGetNextProgram,
cgCreateProgram,
cgDestroyProgram,
cgIsProgram,
cgGetFirstEffect
|