コード例 #1
0
ファイル: CgNativeMethods.cs プロジェクト: primuszp/OpenCg
 private static extern CgBuffer cgCreateBuffer(CgContext context, int size, [In] IntPtr data, CgBufferUsage bufferUsage);
コード例 #2
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateState adds a new state definition to the context.</para>
 /// <para>When a CgFX file is added to the context, all state assignments in the file must have already been defined via a call to cgCreateState or cgCreateArrayState.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_INVALID_PARAMETER_ERROR is generated if name is NULL or not a valid identifier, or if type is not a simple scalar, vector, or matrix-type. Array-typed state should be created with cgCreateArrayState.</para>
 /// <para>VERSION: cgCreateState was introduced in Cg 1.4.</para>
 /// </summary>
 /// <param name="context">The context in which to define the new state.</param>
 /// <param name="name">The name of the new state.</param>
 /// <param name="type">The type of the new state.</param>
 /// <returns>Returns a handle to the newly created CGstate. Returns NULL if there is an error.</returns>
 public static CgState CreateState(CgContext context, [In]string name, CgType type)
 {
     return cgCreateState(context, name, type);
 }
コード例 #3
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgGetAutoCompile returns the auto-compile enumerant for context.</para>
 /// <para>See cgSetAutoCompile for more  information.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgGetAutoCompile was introduced in Cg 1.4.</para>
 /// </summary>
 /// <param name="context">The context.</param>
 /// <returns>Returns the auto-compile enumerant for context. Returns CG_UNKNOWN if context is not a valid context.</returns>
 public static CgEnum GetAutoCompile(CgContext context)
 {
     return cgGetAutoCompile(context);
 }
コード例 #4
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgSetParameterSettingMode controls the behavior of the context when setting parameters.</para>
 /// <para>With deferred param setting, the corresponding 3D API param is not immediately updated by cgSetParameter commands.</para>
 /// <para>If the application does not need to access these 3D API param values, then this mode allows improved performance by avoiding unnecessary 3D API calls.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_INVALID_ENUMERANT_ERROR is generated if parameterSettingMode is not CG_IMMEDIATE_PARAMETER_SETTING or CG_DEFERRED_PARAMETER_SETTING.</para>
 /// <para>VERSION: cgSetParameterSettingMode was introduced in Cg 2.0.</para>
 /// </summary>
 /// <param name="context">The context in which to set the param setting mode.</param>
 /// <param name="parameterSettingMode">The mode to which context will be set.  Must be one of the following :</param>
 public static void SetParameterSettingMode(CgContext context, CgEnum parameterSettingMode)
 {
     cgSetParameterSettingMode(context, parameterSettingMode);
 }
コード例 #5
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateParameterMultiDimArray creates context level shared  multi-dimensional param arrays.</para>
 /// <para>These parameters are primarily used by connecting them to one or more  program param arrays with cgConnectParameter.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_INVALID_VALUE_TYPE_ERROR is generated if type is invalid.</para>
 /// <para>VERSION: cgCreateParameterMultiDimArray was introduced in Cg 1.2.</para>
 /// </summary>
 /// <param name="context">The context to which the new param will be added.</param>
 /// <param name="type">The type of the new param.</param>
 /// <param name="dim">The dimension of the multi-dimensional array.</param>
 /// <param name="lengths">An array of length values, one for each dimension of the array to be created.</param>
 /// <returns>Returns the handle to the new param array.</returns>
 public static CgParameter CreateParameterMultiDimArray(CgContext context, CgType type, int dim, [In]int[] lengths)
 {
     return cgCreateParameterMultiDimArray(context, type, dim, lengths);
 }
コード例 #6
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>Each Cg runtime context maintains a virtual file system of shader source source for inclusion by the compiler.</para>
 /// <para>cgSetCompilerIncludeString populates source source into the virtual filesystem.</para>
 /// <para>A name is removed from the virtual filesystem by using NULL for the source.</para>
 /// <para>The virtual filesystem is completely cleared by using NULL for the name.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgSetCompilerIncludeString was introduced in Cg 2.1.</para>
 /// </summary>
 /// <param name="context">The context in which to add the source source for inclusion by the compiler.</param>
 /// <param name="name">The virtual file system name of the shader source.</param>
 /// <param name="source">Shader source source string.</param>
 public static void SetCompilerIncludeString(CgContext context, string name, string source)
 {
     cgSetCompilerIncludeString(context, name, source);
 }
コード例 #7
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateObjFromFile creates a new CGobj which is a source source object similar to a.</para>
 /// <para>obj or.</para>
 /// <para>o in C/C++ programming where various forms of data can be  extracted.</para>
 /// <para>This can be used, for example, to create user defined data types from a Cg source string.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_INVALID_ENUMERANT_ERROR is generated if program_type is not CG_SOURCE or CG_OBJECT. CG_UNKNOWN_PROFILE_ERROR is generated if profile is not a supported profile. CG_COMPILER_ERROR is generated if compilation fails.</para>
 /// <para>VERSION: cgCreateObjFromFile was introduced in Cg 2.0.</para>
 /// </summary>
 /// <param name="context">The context to which the new object will be added. </param>
 /// <param name="program_type">An enumerant describing the contents of the source string. The following enumerants are allowed: CG_SOURCE - source contains Cg source code. CG_OBJECT - source contains object code that resulted from the precompilation of some Cg source code.</param>
 /// <param name="source_file">Name of a file containing source or object code. See program_type for more information. </param>
 /// <param name="profile">The profile enumerant for the program.</param>
 /// <param name="args">If args is not NULL it is assumed to be an array of NULL-terminated strings that will be passed directly to the compiler as arguments. The last value of the array must be a NULL.</param>
 /// <returns>Returns a CGobj handle on success. Returns NULL if an error occurs.</returns>
 public static CgObj CreateObjFromFile(CgContext context, CgEnum program_type, [In]string source_file, CgProfile profile, [In]string[] args)
 {
     return cgCreateObjFromFile(context, program_type, source_file, profile, args);
 }
コード例 #8
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>The effects in a context can be retrieved directly by name using cgGetNamedEffect.</para>
 /// <para>The effect names can be discovered by iterating through the context's effects (see cgGetFirstEffect and cgGetNextEffect) and calling cgGetEffectName for each.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgGetNamedEffect was introduced in Cg 1.5.</para>
 /// </summary>
 /// <param name="context">The context from which to retrieve the effect.</param>
 /// <param name="name">The name of the effect to retrieve.</param>
 /// <returns>Returns the named effect if found. Returns NULL if context has no effect corresponding to name or if an error occurs.</returns>
 public static CgEffect GetNamedEffect(CgContext context, [In]string name)
 {
     return cgGetNamedEffect(context, name);
 }
コード例 #9
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>The states of a context can be retrieved directly by name using cgGetNamedState.</para>
 /// <para>The names of the states in a context can be discovered by iterating through the context's states (see cgGetFirstState and cgGetNextState), calling cgGetStateName for each one in turn.</para>
 /// <para>ERROR: CG_INVALID_PARAMETER_ERROR is generated if name is NULL.</para>
 /// <para>VERSION: cgGetNamedState was introduced in Cg 1.4.</para>
 /// </summary>
 /// <param name="context">The context from which to retrieve the state.</param>
 /// <param name="name">The name of the state to retrieve.</param>
 /// <returns>Returns the named state from the context. Returns NULL if the context has no state corresponding to name.</returns>
 public static CgState GetNamedState(CgContext context, [In]string name)
 {
     return cgGetNamedState(context, name);
 }
コード例 #10
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgGetFirstState is used to begin iteration over all of the state definitions contained within a context.</para>
 /// <para>See cgGetNextState for more information.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgGetFirstState was introduced in Cg 1.4.</para>
 /// </summary>
 /// <param name="context">The context from which to retrieve the first state definition.</param>
 /// <returns>Returns the first CGstate object in context. Returns NULL if context contains no state definitions or an error occurs.</returns>
 public static CgState GetFirstState(CgContext context)
 {
     return cgGetFirstState(context);
 }
コード例 #11
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>Each Cg context maintains a NULL-terminated string containing warning and error messages generated by the Cg compiler, state managers and the like.</para>
 /// <para>cgGetLastListing allows applications and custom state managers to query the listing text.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgGetLastListing was introduced in Cg 1.1.</para>
 /// </summary>
 /// <param name="context">The context handle.</param>
 /// <returns>Returns a NULL-terminated string containing the current listing text. Returns NULL if no listing text is available, or the listing text string is empty. In all cases, the pointer returned by cgGetLastListing is only guaranteed to be valid until the next Cg entry point not related to error reporting is called. For example, calls to cgCreateProgram, cgCompileProgram, cgCreateEffect, or cgValidateTechnique will invalidate any previously-returned listing pointer.</returns>
 public static string GetLastListing(CgContext context)
 {
     return Marshal.PtrToStringAnsi(cgGetLastListing(context));
 }
コード例 #12
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgGetFirstProgram is used to begin iteration over all of the programs contained within a context.</para>
 /// <para>See cgGetNextProgram for more information.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgGetFirstProgram was introduced in Cg 1.1.</para>
 /// </summary>
 /// <param name="context">The context from which to retrieve the first program.</param>
 /// <returns>Returns the first CgProgram object in context. Returns NULL if context contains no programs or an error occurs.</returns>
 public static CgProgram GetFirstProgram(CgContext context)
 {
     return cgGetFirstProgram(context);
 }
コード例 #13
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgGetFirstEffect is used to begin iteration over all of the effects contained by a context.</para>
 /// <para>See cgGetNextEffect for more information.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgGetFirstEffect was introduced in Cg 1.4.</para>
 /// </summary>
 /// <param name="context">The context from which to retrieve the first effect.</param>
 /// <returns>Returns the first CGeffect object in context. Returns NULL if context contains no effects.</returns>
 public static CgEffect GetFirstEffect(CgContext context)
 {
     return cgGetFirstEffect(context);
 }
コード例 #14
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgGetContextBehavior allows the application to retrieve the behavior enumerant for a context.</para>
 /// <para>The valid enumerants and their meanings are described in cgSetContextBehavior.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgGetContextBehavior was introduced in Cg 3.0.</para>
 /// </summary>
 /// <param name="context">The context for which the behavior enumerant will be returned.</param>
 /// <returns>Returns the behavior enumerant for context. Returns CG_BEHAVIOR_UNKNOWN if an error occurs.</returns>
 public static CgBehavior GetContextBehavior(CgContext context)
 {
     return cgGetContextBehavior(context);
 }
コード例 #15
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <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);
 }
コード例 #16
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateArrayState adds a new array-typed state definition to  context.</para>
 /// <para>Before a CgFX file is added to a context, all state assignments in the file must have previously been defined via a call to cgCreateState or cgCreateArrayState.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_INVALID_PARAMETER_ERROR is generated if name is NULL or not a valid identifier, if type is not a simple scalar, vector, or matrix-type, or if nelements is not a positive number.</para>
 /// <para>VERSION: cgCreateArrayState was introduced in Cg 1.4.</para>
 /// </summary>
 /// <param name="context">The context in which to define the state.</param>
 /// <param name="name">The name of the new state.</param>
 /// <param name="type">The type of the new state.</param>
 /// <param name="nelements">The number of elements in the array.</param>
 /// <returns>Returns a handle to the newly created CGstate. Returns NULL if there is an error.</returns>
 public static CgState CreateArrayState(CgContext context, [In]string name, CgType type, int nelements)
 {
     return cgCreateArrayState(context, name, type, nelements);
 }
コード例 #17
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>Each Cg runtime context maintains a virtual filesystem of shader source source for inclusion by the compiler.</para>
 /// <para>cgSetCompilerIncludeFile populates source source into the virtual filesystem from a file.</para>
 /// <para>A name is removed from the virtual filesystem by using NULL for the filename.</para>
 /// <para>The virtual filesystem is completely cleared by using NULL for the name.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_FILE_READ_ERROR is generated if the file filename can not be opened for input.</para>
 /// <para>VERSION: cgSetCompilerIncludeFile was introduced in Cg 2.1.</para>
 /// </summary>
 /// <param name="context">The context in which to add the source source for inclusion by the compiler.</param>
 /// <param name="name">The virtual file system name of the shader source.</param>
 /// <param name="filename">System file system name of shader source file.</param>
 public static void SetCompilerIncludeFile(CgContext context, string name, string filename)
 {
     cgSetCompilerIncludeFile(context, name, filename);
 }
コード例 #18
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgGetParameterSettingMode returns the current param setting mode enumerant for context.</para>
 /// <para>See cgSetParameterSettingMode for more information.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgGetParameterSettingMode was introduced in Cg 2.0.</para>
 /// </summary>
 /// <param name="context">The context from which the param setting mode will be retrieved.</param>
 /// <returns>Returns the param setting mode enumerant for context. Returns CG_UNKNOWN if an error occurs.</returns>
 public static CgEnum GetParameterSettingMode(CgContext context)
 {
     return cgGetParameterSettingMode(context);
 }
コード例 #19
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>Each new version of Cg is supposed to be completely backwards compatible with previous versions, providing bug fixes and/or new capabilities while maintaining the behavior which applications were written against.</para>
 /// <para>The intent is to allow Cg to be updated and have existing applications continue to work exactly as designed.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_INVALID_ENUMERANT_ERROR is generated if behavior is not CG_BEHAVIOR_3000, CG_BEHAVIOR_2200, CG_BEHAVIOR_CURRENT, or CG_BEHAVIOR_LATEST.</para>
 /// <para>VERSION: cgSetContextBehavior was introduced in Cg 3.0.</para>
 /// </summary>
 /// <param name="context">The context for which the behavior will be set.</param>
 /// <param name="behavior">An enumerant which defines the behavior that will be exhibited by context.  The following enumerants are allowed:</param>
 public static void SetContextBehavior(CgContext context, CgBehavior behavior)
 {
     cgSetContextBehavior(context, behavior);
 }
コード例 #20
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateBuffer creates a runtime managed Cg buffer object.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgCreateBuffer was introduced in Cg 2.0.</para>
 /// </summary>
 /// <param name="context">The context to which the new buffer will be added.</param>
 /// <param name="size">The length in bytes of the buffer to create.</param>
 /// <param name="data">Pointer to inital buffer data. NULL will fill the buffer with zero.</param>
 /// <param name="bufferUsage">Indicates the intended usage method of the buffer.</param>
 /// <returns>Returns a CgBuffer handle on success. Returns NULL if an error occurs.</returns>
 public static CgBuffer CreateBuffer(CgContext context, int size, [In]IntPtr data, CgBufferUsage bufferUsage)
 {
     return cgCreateBuffer(context, size, data, bufferUsage);
 }
コード例 #21
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateParameter creates context level shared parameters.</para>
 /// <para>These parameters are primarily used by connecting them to one or more  program parameters with cgConnectParameter.</para>
 /// <para>ERROR: CG_INVALID_VALUE_TYPE_ERROR is generated if type is invalid. CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgCreateParameter was introduced in Cg 1.2.</para>
 /// </summary>
 /// <param name="context">The context to which the new param will be added.</param>
 /// <param name="type">The type of the new param.</param>
 /// <returns>Returns the handle to the new param.</returns>
 public static CgParameter CreateParameter(CgContext context, CgType type)
 {
     return cgCreateParameter(context, type);
 }
コード例 #22
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateEffect generates a new CGeffect object and adds it to the specified Cg context.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_COMPILER_ERROR is generated if compilation fails.</para>
 /// <para>VERSION: cgCreateEffect was introduced in Cg 1.4.</para>
 /// </summary>
 /// <param name="context">The context to which the new effect will be added.</param>
 /// <param name="source">A string containing the effect's source source.</param>
 /// <param name="args">If args is not NULL it is assumed to be an array of NULL-terminated  strings that will be passed directly to the compiler as arguments.  The last value of the array must be a NULL.</param>
 /// <returns>Returns a CGeffect handle on success. Returns NULL if an error occurs.</returns>
 public static CgEffect CreateEffect(CgContext context, [In]string source, [In]string[] args)
 {
     return cgCreateEffect(context, source, args);
 }
コード例 #23
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateParameterArray creates context level shared param arrays.</para>
 /// <para>These parameters are primarily used by connecting them to one or more  program param arrays with cgConnectParameter.</para>
 /// <para>ERROR: CG_INVALID_VALUE_TYPE_ERROR is generated if type is invalid. CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgCreateParameterArray was introduced in Cg 1.2.</para>
 /// </summary>
 /// <param name="context">The context to which the new param will be added.</param>
 /// <param name="type">The type of the new param.</param>
 /// <param name="length">The length of the array being created.</param>
 /// <returns>Returns the handle to the new param array.</returns>
 public static CgParameter CreateParameterArray(CgContext context, CgType type, int length)
 {
     return cgCreateParameterArray(context, type, length);
 }
コード例 #24
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateEffectFromFile generates a new CGeffect object and adds it to the specified Cg context.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_FILE_READ_ERROR is generated if the given filename cannot be read. CG_COMPILER_ERROR is generated if compilation fails.</para>
 /// <para>VERSION: cgCreateEffectFromFile was introduced in Cg 1.4.</para>
 /// </summary>
 /// <param name="context">The context to which the new effect will be added.</param>
 /// <param name="filename">Name of a file that contains the effect's source source.</param>
 /// <param name="args">If args is not NULL it is assumed to be an array of NULL-terminated  strings that will be passed directly to the compiler as arguments.  The last value of the array must be a NULL.</param>
 /// <returns>Returns a CGeffect handle on success. Returns NULL if an error occurs.</returns>
 public static CgEffect CreateEffectFromFile(CgContext context, [In]string filename, [In]string[] args)
 {
     return cgCreateEffectFromFile(context, filename, args);
 }
コード例 #25
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgCreateProgramFromFile  generates a new CgProgram  object and adds it to the specified Cg context.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_INVALID_ENUMERANT_ERROR is generated if program_type is not CG_SOURCE or CG_OBJECT. CG_UNKNOWN_PROFILE_ERROR is generated if profile is not a supported profile. CG_COMPILER_ERROR is generated if compilation fails.</para>
 /// <para>VERSION: cgCreateProgramFromFile was introduced in Cg 1.1.</para>
 /// </summary>
 /// <param name="context">The context to which the new program will be added.</param>
 /// <param name="program_type">An enumerant describing the contents of the program_file. The following enumerants are allowed: CG_SOURCE - source contains Cg source code. CG_OBJECT - source contains object code that resulted from the precompilation of some Cg source code.</param>
 /// <param name="program_file">Name of a file containing source or object code. See program_type for more information. </param>
 /// <param name="profile">The profile enumerant for the program. </param>
 /// <param name="entry">The entry point to the program in the Cg source. If NULL, the entry point defaults to "main". </param>
 /// <param name="args">If args is not NULL it is assumed to be an array of NULL-terminated strings that will be passed directly to the compiler as arguments. The last value of the array must be a NULL.</param>
 /// <returns>Returns a CgProgram handle on success. Returns NULL if an error occurs.</returns>
 public static CgProgram CreateProgramFromFile(CgContext context, CgEnum program_type, [In]string program_file, CgProfile profile, [In]string entry, string[] args)
 {
     return cgCreateProgramFromFile(context, program_type, program_file, profile, entry, args);
 }
コード例 #26
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgIsContext returns CG_TRUE if context references a valid context, CG_FALSE otherwise.</para>
 /// <para>VERSION: cgIsContext was introduced in Cg 1.1.</para>
 /// </summary>
 /// <param name="context">The context handle to check.</param>
 /// <returns>Returns CG_TRUE if context references a valid context. Returns CG_FALSE otherwise.</returns>
 public static CgBool IsContext(CgContext context)
 {
     return cgIsContext(context);
 }
コード例 #27
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgDestroyContext deletes a Cg context object and all the programs it contains.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgDestroyContext was introduced in Cg 1.1.</para>
 /// </summary>
 /// <param name="context">The context to be deleted.</param>
 public static void DestroyContext(CgContext context)
 {
     cgDestroyContext(context);
 }
コード例 #28
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgSetAutoCompile sets the auto compile mode for a given  context.</para>
 /// <para>By default, programs are immediately recompiled when they enter an uncompiled state.</para>
 /// <para>This may happen for a variety of reasons including :.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context. CG_INVALID_ENUMERANT_ERROR is generated if autoCompileMode is not CG_COMPILE_MANUAL, CG_COMPILE_IMMEDIATE, or CG_COMPILE_LAZY.</para>
 /// <para>VERSION: cgSetAutoCompile was introduced in Cg 1.2.</para>
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="autoCompileMode">The auto-compile mode to which to set context.  Must be one of the following :</param>
 public static void SetAutoCompile(CgContext context, CgEnum autoCompileMode)
 {
     cgSetAutoCompile(context, autoCompileMode);
 }
コード例 #29
0
ファイル: Cg.cs プロジェクト: primuszp/OpenCg
 /// <summary>
 /// <para>cgGetCompilerIncludeCallback returns the current callback function used for handing include statements.</para>
 /// <para>ERROR: CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.</para>
 /// <para>VERSION: cgGetCompilerIncludeCallback was introduced in Cg 2.1.</para>
 /// </summary>
 /// <param name="context">The context of the desired include callback function.</param>
 /// <returns>Returns the current include callback function. Returns NULL if no callback function is set.</returns>
 public static IncludeCallbackFuncDelegate GetCompilerIncludeCallback(CgContext context)
 {
     return cgGetCompilerIncludeCallback(context);
 }
コード例 #30
0
ファイル: CgNativeMethods.cs プロジェクト: primuszp/OpenCg
 private static extern CgState cgCreateArrayState(CgContext context, [In] string name, CgType type, int nelems);