cgGetFirstProgram(3)

NAME
cgGetFirstProgram - get the first program in a context

SYNOPSIS
  #include <Cg/cg.h>
  CGprogram cgGetFirstProgram( CGcontext context );

PARAMETERS
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 the cgGetNextProgram manpage 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
the cgGetNextProgram manpage, the cgCreateProgram manpage, the cgDestroyProgram manpage, the cgIsProgram manpage