/// <summary> /// <para>cgSetCompilerIncludeCallback sets a callback function used for handing include statements.</para> /// <para>Each Cg runtime context maintains a virtual file system of shader source source for inclusion by the compiler.</para> /// <para>Source source is populated into the virtual filesystem using cgSetCompilerIncludeString and cgSetCompilerIncludeFile.</para> /// <para>When the compiler encounters an include, firstly the virtual file system is searched for a match.</para> /// <para>Secondly the include callback function is called, providing an opportunity for populating shader source via cgSetCompilerIncludeString and cgSetCompilerIncludeFile.</para> /// <para>The callback function is passed the context and the requested name.</para> /// <para>Thirdly, the filesystem is searched in the usual manner.</para> /// <para>Fourthly, an error is raised by the compiler that the include can not be satisfied.</para> /// <para>NULL is passed to cgSetCompilerIncludeCallback to disable the callback.</para> /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para> /// <para>VERSION: cgSetCompilerIncludeCallback was introduced in Cg 2.1.</para> /// </summary> /// <param name="context">The context for which the include callback will be used.</param> /// <param name="func">A pointer to the include callback function.</param> public static void SetCompilerIncludeCallback(CgContext context, IncludeCallbackFuncDelegate func) { cgSetCompilerIncludeCallback(context, func); }
private static extern void cgSetCompilerIncludeCallback(CgContext context, IncludeCallbackFuncDelegate func);