cgGetFirstParameter(3)

NAME
cgGetFirstParameter - get the first parameter in a program

SYNOPSIS
  #include <Cg/cg.h>
  CGparameter cgGetFirstParameter( CGprogram program,
                                   CGenum name_space );

PARAMETERS
The program from which to retrieve the first parameter. Specifies the parameter namespace through which to iterate. Currently CG_PROGRAM and CG_GLOBAL are supported.

RETURN VALUES
Returns the first CGparameter object in program.

Returns NULL if program is invalid or if program does not have any parameters.

DESCRIPTION
cgGetFirstParameter returns the first top-level parameter in a program. cgGetFirstParameter is used for recursing through all parameters in a program. See the cgGetNextParameter manpage for more information on parameter traversal.

EXAMPLES
  CGparameter param = cgGetFirstParameter( program, CG_GLOBAL );
  while ( param )
  {
    /* Do stuff with leaf */
    param = cgGetNextParameter( param );
  }

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

CG_INVALID_ENUMERANT_ERROR is generated if name_space is not CG_PROGRAM or CG_GLOBAL.

HISTORY
cgGetFirstParameter was introduced in Cg 1.1.

SEE ALSO
the cgGetNextParameter manpage