NAME

cgGetNamedPassAnnotation - get a pass annotation by name

SYNOPSIS

  #include <Cg/cg.h>

  CGannotation cgGetNamedPassAnnotation( CGpass pass,
                                         const char * name );

PARAMETERS

pass

The pass from which to retrieve the annotation.

name

The name of the annotation to retrieve.

RETURN VALUES

Returns the named annotation. If the pass has no annotation corresponding to name, NULL is returned.

DESCRIPTION

The annotations associated with a pass can be retrieved directly by name using the cgGetNamedPassAnnotation function. The names of a pass's annotations can be discovered by iterating through the annotations (see cgGetFirstPassAnnotation and cgGetNextAnnotation), calling cgGetAnnotationName for each one in turn.

EXAMPLES

The following example code illustrates the use of cgGetNamedPassAnnotation:

  /* fetch annotation "Apple" from CGpass pass */
  CGannotation ann = cgGetNamedPassAnnotation( pass, "Apple" );
  while( ann )
  {
     /* do something with ann */
     ann = cgGetNextAnnotation( ann );
  }

ERRORS

CG_INVALID_PASS_HANDLE_ERROR is generated if pass does not refer to a valid pass.

HISTORY

cgGetNamedPassAnnotation was introduced in Cg 1.4.

SEE ALSO

cgGetFirstPassAnnotation, cgGetNextPassAnnotation, cgGetAnnotationName