cgCombinePrograms(3)

NAME
cgCombinePrograms - combine programs from different domains

SYNOPSIS
  #include <Cg/cg.h>
  CGprogram cgCombinePrograms( int n,
                               const CGprogram * exeList );

PARAMETERS

n   The number of program objects in exeList.

exeList
    An array of two or more executable programs, each from a different domain.

RETURN VALUES
Returns a handle to the newly created program on success.

Returns NULL if an error occurs.

DESCRIPTION
cgCombinePrograms will take a set of n programs and combine them into a single CGprogram. This allows a single call to BindProgram (instead of a BindProgram for each individual program) and provides optimizations between the combined set of program inputs and outputs.

EXAMPLES
CGprogram p1 = cgCreateProgram(context, CG_SOURCE, vSrc, vProfile, vEntryName, NULL); CGprogram p2 = cgCreateProgram(context, CG_SOURCE, fSrc, fProfile, fEntryName, NULL);

CGprogram programs[] = {p1, p2}; CGprogram combined = cgCombinePrograms(2, programs);

cgDestroyProgram(p1); cgDestroyProgram(p2);

cgGLBindProgram(combined); /* Assuming cgGL runtime */

/* Render... */

ERRORS
CG_INVALID_DIMENSION_ERROR is generated if n less than or equal to 1 or n is greater than 3.

CG_INVALID_PARAMETER_ERROR is generated if exeList is NULL.

CG_INVALID_PROGRAM_HANDLE_ERROR is generated if one of the programs in exeList is invalid.

The errors listed in the cgCreateProgram manpage might also be generated.

HISTORY
cgCombinePrograms was introduced in Cg 1.5.

SEE ALSO
the cgCombinePrograms2 manpage, the cgCombinePrograms3 manpage, the cgCreateProgram manpage, the cgGLBindProgram manpage, the cgD3D9BindProgram manpage, the cgD3D8BindProgram manpage