NAME
    cgCreateProgram - generate a new program object from a string

SYNOPSIS
      #include <Cg/cg.h>

      CGprogram cgCreateProgram(CGcontext ctx, 
                                CGenum program_type,
                                const char *program,
                                CGprofile profile,
                                const char *entry,
                                const char **args)

PARAMETERS
    ctx     Specifies the context that the new program will be added to.



    program_type
            The program_type parameter is an enumerant that describes what
            the program parameter string contains. The following is a list
            of valid enumerants that may be passed in :

            CG_SOURCE
                If program_type is CG_SOURCE, program is assumed to be a
                string that contains Cg source code.

            CG_OBJECT
                If program_type is CG_OBJECT, program is assumed to be a
                string that contains object code that resulted from the
                precompilation of some Cg source code.

    program A string containing either the programs source or object code.
            See the program parameter above for more information.

    profile The enumerant for the profile the program.

    entry   The entry point to the program in the Cg source. If set to NULL
            this will default to "main".

    args    If args is not NULL it is assumed to be an array of
            null-terminated strings that will be passed as directly to the
            compiler as arguments. The last value of the array must be a
            NULL.

DESCRIPTION
    cgCreateProgram generates a new CGprogram object and adds it to the
    specified Cg context.

    The following is a typical sequence of commands for initializing a new
    program:

       CGcontext ctx = cgCreateContext();
       CGprogram prog = cgCreateProgram(ctx,
                                        CG_SOURCE,
                                        mysourcepointer,
                                        CG_PROFILE_ARBVP1,
                                        "myshader",
                                        NULL);

RETURN VALUES
    Returns a CGprogram handle on success.

    Returns NULL if any error occurs.

ERRORS
    CG_INVALID_CONTEXT_HANDLE_ERROR is generated if the ctx is not a valid
    context.

    CG_INVALID_ENUMERANT_ERROR is generated if program_type is an invalid
    enumerant.

    CG_UNKNOWN_PROFILE_ERROR is generated if profile is not a supported
    profile.

    CG_COMPILE_ERROR is generated if the compile failed.

SEE ALSO
    the cgCreateContext manpage, and the cgGetProgramString manpage

