NAME

cgCreateProgramAnnotation - create a program annotation

SYNOPSIS

  #include <Cg/cg.h>

  CGannotation cgCreateProgramAnnotation( CGprogram program,
                                          const char * name,
                                          CGtype type );

PARAMETERS

program

The program to which the new annotation will be added.

name

The name of the new annotation.

type

The type of the new annotation.

RETURN VALUES

Returns the new CGannotation handle on success.

Returns NULL if any error occurs.

DESCRIPTION

cgCreateProgramAnnotation adds a new annotation to the program.

EXAMPLES

The following example code illustrates the use of cgCreateProgramAnnotation:

  // create a float annotation named "Apple" for CGprogram prog
  CGannotation anno = cgCreateProgramAnnotation( prog, "Apple", CG_FLOAT );

ERRORS

CG_INVALID_PROGRAM_HANDLE_ERROR is generated if program is not a valid program.

CG_DUPLICATE_NAME_ERROR is generated if name is already used by an annotation for this program.

CG_INVALID_ENUMERANT_ERROR is generated if type is not one of CG_INT, CG_FLOAT, CG_BOOL, or CG_STRING.

HISTORY

cgCreateProgramAnnotation was introduced in Cg 1.5.

SEE ALSO

cgGetNamedProgramAnnotation, cgGetFirstProgramAnnotation