> # NAME

> cgSetCompilerIncludeCallback - set the include callback function

> # SYNOPSIS

>       #include <Cg/cg.h>

>       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. NULL is passed to cgSetCompilerIncludeCallback to disable the callback.

> # EXAMPLES

> # ERRORS

> CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.

> # HISTORY

> cgSetCompilerIncludeCallback was introduced in Cg 2.1.

> # SEE ALSO

> cgGetCompilerIncludeCallback, cgSetCompilerIncludeString, cgSetCompilerIncludeFile