MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Cg Core Runtime API               cgSetCompilerIncludeCallback(3)



NAME
     cgSetCompilerIncludeCallback - set the include callback
     function

SYNOPSIS
       #include 

       typedef void (*CGIncludeCallbackFunc)( CGcontext context, const char *filename );

       void cgSetCompilerIncludeCallback( CGcontext context, CGIncludeCallbackFunc func );


PARAMETERS
     context The context for which the include callback will be
             used.

     func    A pointer to the include callback function.

RETURN VALUES
     None.

DESCRIPTION
     cgSetCompilerIncludeCallback sets a callback function used
     for handing include statements.  Each Cg runtime context
     maintains a virtual file system of shader source code for
     inclusion by the compiler.  Source code is populated into
     the virtual filesystem using cgSetCompilerIncludeString and
     cgSetCompilerIncludeFile.  When the compiler encounters an
     include, firstly the virtual file system is searched for a
     match.  Secondly the include callback function is called,
     providing an opportunity for populating shader source via
     cgSetCompilerIncludeString and cgSetCompilerIncludeFile.
     The callback function is passed the context and the
     requested name.  Thirdly, the filesystem is searched in the
     usual manner.  Fourthly, an error is raised by the compiler
     that the include can not be satisfied.  NUL is passed to
     cgSetCompilerIncludeCallback to disable the callback.

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

HISTORY
     cgSetCompilerIncludeCallback was introduced in Cg 2.1.

SEE ALSO
     cgGetCompilerIncludeCallback, cgSetCompilerIncludeString,
     cgSetCompilerIncludeFile






Cg Toolkit 2.1            Last change:                          1



OpenSolaris man pages main menu

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