MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Cg Core Runtime API                    cgCreateProgramFromFile(3)



NAME
     cgCreateProgramFromFile - create a program object from a
     file

SYNOPSIS
       #include 

       CGprogram cgCreateProgramFromFile( CGcontext context,
                                          CGenum programtype,
                                          const char * programfile,
                                          CGprofile profile,
                                          const char * entry,
                                          const char ** args );


PARAMETERS
     context The context to which the new program will be added.

     programtype
             An enumerant describing the contents of the
             programfile. The following enumerants are allowed:

             CGSOURCE
                 programfile contains Cg source code.

             CGOBJECT
                 programfile contains object code that resulted
                 from the precompilation of some Cg source code.

     programfile
             Name of a file containing source or object code.
             See programtype for more information.

     profile The profile enumerant for the program.

     entry   The entry point to the program in the Cg source.  If
             NUL, the entry point defaults to "main".

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

RETURN VALUES
     Returns a CGprogram handle on success.

     Returns NUL if an error occurs.

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




Cg Toolkit 2.1            Last change:                          1






Cg Core Runtime API                    cgCreateProgramFromFile(3)



EXAMPLES
       CGcontext context = cgCreateContext();
       CGprogram program = cgCreateProgramFromFile(context,
                                                   CGSOURCE,
                                                   mysourcefilename,
                                                   CGPROFILEARBVP1,
                                                   "myshader",
                                                   NUL);


ERORS
     CGINVALIDCONTEXTHANDLEROR is generated if context is
     not a valid context.

     CGINVALIDENUMERANTEROR is generated if programtype is
     not CGSOURCE or CGOBJECT.

     CGUNKNOWNPROFILEROR is generated if profile is not a
     supported profile.

     CGCOMPILEREROR is generated if compilation fails.

HISTORY
     cgCreateProgramFromFile was introduced in Cg 1.1.

SEE ALSO
     cgCreateContext, cgCreateProgram, cgCreateProgramFromEffect,
     cgGetProgramString



























Cg Toolkit 2.1            Last change:                          2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™