Commits

Tobias Bohnen committed 82bf54c

*update to Cg 3.1.0013

Comments (0)

Files changed (55)

 glob:*.testsettings
 glob:CgReferenceManual.chw
 *.docstates
+Tools/CgToCode/*

CgNet/Annotation.cs

         {
             get
             {
-                return CgNativeMethods.cgGetNumDependentAnnotationParameters(this.Handle);
+                return NativeMethods.cgGetNumDependentAnnotationParameters(this.Handle);
             }
         }
 
         {
             get
             {
-                return CgNativeMethods.cgIsAnnotation(this.Handle);
+                return NativeMethods.cgIsAnnotation(this.Handle);
             }
         }
 
         {
             get
             {
-                return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetAnnotationName(this.Handle));
+                return Marshal.PtrToStringAnsi(NativeMethods.cgGetAnnotationName(this.Handle));
             }
         }
 
         {
             get
             {
-                var ptr = CgNativeMethods.cgGetNextAnnotation(this.Handle);
+                var ptr = NativeMethods.cgGetNextAnnotation(this.Handle);
                 return ptr == IntPtr.Zero ? null : new Annotation(ptr)
                                                    {
                                                        OwnsHandle = false
         {
             get
             {
-                return CgNativeMethods.cgGetAnnotationType(this.Handle);
+                return NativeMethods.cgGetAnnotationType(this.Handle);
             }
         }
 
         public bool[] GetBoolValues()
         {
             int count;
-            var values = CgNativeMethods.cgGetBoolAnnotationValues(this.Handle, out count);
+            var values = NativeMethods.cgGetBoolAnnotationValues(this.Handle, out count);
             return Cg.IntPtrToBoolArray(values, count);
         }
 
         /// <returns>Returns the selected dependent annotation on success.</returns>
         public Parameter GetDependentParameter(int index)
         {
-            var ptr = CgNativeMethods.cgGetDependentAnnotationParameter(this.Handle, index);
+            var ptr = NativeMethods.cgGetDependentAnnotationParameter(this.Handle, index);
             return ptr == IntPtr.Zero ? null : new Parameter(ptr)
                                                {
                                                    OwnsHandle = false
         public float[] GetFloatValues()
         {
             int nvalues;
-            return CgNativeMethods.cgGetFloatAnnotationValues(this.Handle, out nvalues);
+            return NativeMethods.cgGetFloatAnnotationValues(this.Handle, out nvalues);
         }
 
         /// <summary>
         public int[] GetIntValues()
         {
             int nvalues;
-            return CgNativeMethods.cgGetIntAnnotationValues(this.Handle, out nvalues);
+            return NativeMethods.cgGetIntAnnotationValues(this.Handle, out nvalues);
         }
 
         /// <summary>
         /// <returns>Returns a string contained by the annotation. </returns>
         public string GetStringValue()
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetStringAnnotationValue(this.Handle));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetStringAnnotationValue(this.Handle));
         }
 
         /// <summary>
         public string[] GetStringValues()
         {
             int nvalues;
-            var ptr = CgNativeMethods.cgGetStringAnnotationValues(this.Handle, out nvalues);
+            var ptr = NativeMethods.cgGetStringAnnotationValues(this.Handle, out nvalues);
             if (nvalues == 0)
             {
                 return null;
         /// <returns>Returns <c>true</c> if it succeeds in setting the annotation; <c>false</c> otherwise.</returns>
         public bool Set(int value)
         {
-            return CgNativeMethods.cgSetIntAnnotation(this.Handle, value);
+            return NativeMethods.cgSetIntAnnotation(this.Handle, value);
         }
 
         /// <summary>
         /// <returns>Returns <c>true</c> if it succeeds in setting the annotation; <c>false</c> otherwise.</returns>
         public bool Set(float value)
         {
-            return CgNativeMethods.cgSetFloatAnnotation(this.Handle, value);
+            return NativeMethods.cgSetFloatAnnotation(this.Handle, value);
         }
 
         /// <summary>
         /// <returns>Returns <c>true</c> if it succeeds in setting the annotation; <c>false</c> otherwise.</returns>
         public bool Set(string value)
         {
-            return CgNativeMethods.cgSetStringAnnotation(this.Handle, value);
+            return NativeMethods.cgSetStringAnnotation(this.Handle, value);
         }
 
         /// <summary>
         /// <returns>Returns <c>true</c> if it succeeds in setting the annotation; <c>false</c> otherwise.</returns>
         public bool Set(bool value)
         {
-            return CgNativeMethods.cgSetBoolAnnotation(this.Handle, value);
+            return NativeMethods.cgSetBoolAnnotation(this.Handle, value);
         }
 
         #endregion Public Methods
 
         #region Public Properties
 
+        public bool IsBuffer
+        {
+            get
+            {
+                return NativeMethods.cgIsBuffer(this.Handle);
+            }
+        }
+
         /// <summary>
         /// Gets the size.
         /// </summary>
         {
             get
             {
-                return CgNativeMethods.cgGetBufferSize(this.Handle);
+                return NativeMethods.cgGetBufferSize(this.Handle);
             }
         }
 
         /// <returns>Returns a Buffer on success.</returns>
         public static Buffer Create(Context context, int size, IntPtr data, BufferUsage bufferUsage)
         {
-            return new Buffer(CgNativeMethods.cgCreateBuffer(context.Handle, size, data, bufferUsage));
+            return new Buffer(NativeMethods.cgCreateBuffer(context.Handle, size, data, bufferUsage));
         }
 
         #endregion Public Static Methods
         /// <returns>Returns a pointer through which the application can read or write the buffer's data store.</returns>
         public IntPtr Map(BufferAccess access)
         {
-            return CgNativeMethods.cgMapBuffer(this.Handle, access);
+            return NativeMethods.cgMapBuffer(this.Handle, access);
         }
 
         /// <summary>
         /// <param name="data">Pointer to the data to copy into the buffer. The number of bytes to copy is determined by the size parameter.</param>
         public void SetData(int size, IntPtr data)
         {
-            CgNativeMethods.cgSetBufferData(this.Handle, size, data);
+            NativeMethods.cgSetBufferData(this.Handle, size, data);
         }
 
         /// <summary>
         /// <param name="data">Pointer to the start of the data being copied into the buffer.</param>
         public void SetSubData(int offset, int size, IntPtr data)
         {
-            CgNativeMethods.cgSetBufferSubData(this.Handle, offset, size, data);
+            NativeMethods.cgSetBufferSubData(this.Handle, offset, size, data);
         }
 
         /// <summary>
         /// </summary>
         public void Unmap()
         {
-            CgNativeMethods.cgUnmapBuffer(this.Handle);
+            NativeMethods.cgUnmapBuffer(this.Handle);
         }
 
         #endregion Public Methods
         {
             if (this.OwnsHandle && this.Handle != IntPtr.Zero)
             {
-                CgNativeMethods.cgDestroyBuffer(this.Handle);
+                NativeMethods.cgDestroyBuffer(this.Handle);
             }
         }
 
                 {
                     if (error == null)
                     {
-                        CgNativeMethods.cgSetErrorCallback(OnError);
+                        NativeMethods.cgSetErrorCallback(OnError);
                     }
 
                     error += value;
 
                     if (error == null)
                     {
-                        CgNativeMethods.cgSetErrorCallback(null);
+                        NativeMethods.cgSetErrorCallback(null);
                     }
                 }
             }
         {
             get
             {
-                return CgNativeMethods.cgGetLockingPolicy();
+                return NativeMethods.cgGetLockingPolicy();
             }
 
             set
             {
-                CgNativeMethods.cgSetLockingPolicy(value);
+                NativeMethods.cgSetLockingPolicy(value);
             }
         }
 
         {
             get
             {
-                return CgNativeMethods.cgGetSemanticCasePolicy();
+                return NativeMethods.cgGetSemanticCasePolicy();
             }
 
             set
             {
-                CgNativeMethods.cgSetSemanticCasePolicy(value);
+                NativeMethods.cgSetSemanticCasePolicy(value);
             }
         }
 
         {
             get
             {
-                return CgNativeMethods.cgGetNumSupportedProfiles();
+                return NativeMethods.cgGetNumSupportedProfiles();
             }
         }
 
 
         public static ErrorType GetError()
         {
-            return CgNativeMethods.cgGetError();
+            return NativeMethods.cgGetError();
         }
 
         public static CgErrorHandlerFuncDelegate GetErrorHandler(IntPtr data)
         {
-            return CgNativeMethods.cgGetErrorHandler(data);
+            return NativeMethods.cgGetErrorHandler(data);
         }
 
         public static ErrorType GetFirstError()
         {
-            return CgNativeMethods.cgGetFirstError();
+            return NativeMethods.cgGetFirstError();
         }
 
         public static string GetLastErrorString(out ErrorType error)
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetLastErrorString(out error));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetLastErrorString(out error));
         }
 
         public static ParameterType GetMatrixSize(ParameterType type, out int nrows, out int ncols)
         {
-            return CgNativeMethods.cgGetMatrixSize(type, out nrows, out ncols);
+            return NativeMethods.cgGetMatrixSize(type, out nrows, out ncols);
         }
 
         public static ParameterType GetParentType(ParameterType type, int index)
         {
-            return CgNativeMethods.cgGetParentType(type, index);
+            return NativeMethods.cgGetParentType(type, index);
         }
 
         public static int GetParentTypesCount(ParameterType type)
         {
-            return CgNativeMethods.cgGetNumParentTypes(type);
+            return NativeMethods.cgGetNumParentTypes(type);
         }
 
         public static Domain GetProfileDomain(ProfileType profile)
         {
-            return CgNativeMethods.cgGetProfileDomain(profile);
+            return NativeMethods.cgGetProfileDomain(profile);
         }
 
         public static bool GetProfileProperty(ProfileType profile, Query query)
         {
-            return CgNativeMethods.cgGetProfileProperty(profile, query);
+            return NativeMethods.cgGetProfileProperty(profile, query);
         }
 
         public static int GetProgramBufferMaxIndex(ProfileType profile)
         {
-            return CgNativeMethods.cgGetProgramBufferMaxIndex(profile);
+            return NativeMethods.cgGetProgramBufferMaxIndex(profile);
         }
 
         public static int GetProgramBufferMaxSize(ProfileType profile)
         {
-            return CgNativeMethods.cgGetProgramBufferMaxSize(profile);
+            return NativeMethods.cgGetProgramBufferMaxSize(profile);
         }
 
         public static ProfileType GetSupportedProfile(int index)
         {
-            return CgNativeMethods.cgGetSupportedProfile(index);
+            return NativeMethods.cgGetSupportedProfile(index);
         }
 
         public static bool GetTypeSizes(ParameterType type, out int nrows, out int ncols)
         {
-            return CgNativeMethods.cgGetTypeSizes(type, out nrows, out ncols);
+            return NativeMethods.cgGetTypeSizes(type, out nrows, out ncols);
         }
 
         public static bool IsInterfaceType(ParameterType type)
         {
-            return CgNativeMethods.cgIsInterfaceType(type);
+            return NativeMethods.cgIsInterfaceType(type);
         }
 
         public static bool IsParentType(ParameterType parent, int child)
         {
-            return CgNativeMethods.cgIsParentType(parent, child);
+            return NativeMethods.cgIsParentType(parent, child);
         }
 
         public static bool IsProfileSupported(ProfileType profile)
         {
-            return CgNativeMethods.cgIsProfileSupported(profile);
+            return NativeMethods.cgIsProfileSupported(profile);
         }
 
         public static void SetErrorHandler(CgErrorHandlerFuncDelegate func, IntPtr data)
         {
-            CgNativeMethods.cgSetErrorHandler(func, data);
+            NativeMethods.cgSetErrorHandler(func, data);
         }
 
         #endregion Public Static Methods
                     var ii = (int*)values;
                     for (int i = 0; i < count; i++)
                     {
-                        retValue[i] = ii[i] == CgNativeMethods.CgTrue;
+                        retValue[i] = ii[i] == NativeMethods.CgTrue;
                     }
                 }
 
     public enum Behavior
     {
         Unknown = 0,
-        Latest = 1, /* latest behavior supported at runtime      */
-        Behavior2200 = 1000, /* default behavior                          */
+        Latest = 1,
+        Behavior2200 = 1000,
         Behavior3000 = 2000,
-        Current = Behavior3000 /* latest behavior supported at compile time */
+        Behavior3100 = 3000,
+        Current = Behavior3100
     }
 
     public enum BufferAccess
         IsTessellationControlProfile = 4149,
         IsTessellationEvaluationProfile = 4150,
         Patch = 4152, /* GetProgramInput and GetProgramOutput */
-        IsDirect3D11Profile = 4153
+        IsDirect3D11Profile = 4153,
+        SamplePos = 4420,
+        NumSamples = 4421,
     }
 
     public enum Domain
         Struct = 4,
         Array = 5,
         Sampler = 6,
-        Object = 7
+        Object = 7,
+        Buffer = 8
     }
 
     public enum ParameterDirection
         TypeStartEnum = 1024,
         Sampler = 1143,
         Sampler1D = 1065,
-        Sampler1Darray = 1138,
-        Sampler1Dshadow = 1313,
+        Sampler1DArray = 1138,
+        Sampler1DShadow = 1313,
         Sampler2D = 1066,
-        Sampler2Darray = 1139,
-        Sampler2Dshadow = 1314,
+        Sampler2DArray = 1139,
+        Sampler2DMS       = 1317,
+        Sampler2DMSArray  = 1318,
+        Sampler2DShadow = 1314,
+        SamplerRBuf       = 1316,
         Sampler3D = 1067,
-        Samplerbuf = 1144,
-        Samplercube = 1069,
-        Samplercubearray = 1140,
-        Samplerrect = 1068,
-        Samplerrectshadow = 1315,
+        SamplerBuf = 1144,
+        SamplerCube = 1069,
+        SamplerCubeArray = 1140,
+        SamplerRect = 1068,
+        SamplerRectShadow = 1315,
         Bool = 1114,
         Bool1 = 1115,
         Bool2 = 1116,
 
         public static Behavior GetBehavior(string behaviorString)
         {
-            return CgNativeMethods.cgGetBehavior(behaviorString);
+            return NativeMethods.cgGetBehavior(behaviorString);
         }
 
-        public static string GetBehaviorString(Behavior behavior)
+        public static string GetBehavior(Behavior behavior)
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetBehaviorString(behavior));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetBehaviorString(behavior));
         }
 
         public static Domain GetDomain(string domainString)
         {
-            return CgNativeMethods.cgGetDomain(domainString);
+            return NativeMethods.cgGetDomain(domainString);
         }
 
-        public static string GetDomainString(Domain domain)
+        public static string GetDomain(Domain domain)
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetDomainString(domain));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetDomainString(domain));
         }
 
         public static int GetEnum(string enumString)
         {
-            return CgNativeMethods.cgGetEnum(enumString);
+            return NativeMethods.cgGetEnum(enumString);
         }
 
-        public static string GetEnumString(int @enum)
+        public static string GetEnum(int @enum)
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetEnumString(@enum));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetEnumString(@enum));
         }
 
-        public static string GetErrorString(ErrorType error)
+        public static string GetError(ErrorType error)
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetErrorString(error));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetErrorString(error));
         }
 
         public static ParameterClass GetParameterClassEnum(string pString)
         {
-            return CgNativeMethods.cgGetParameterClassEnum(pString);
+            return NativeMethods.cgGetParameterClassEnum(pString);
         }
 
         public static string GetParameterClassString(ParameterClass pc)
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetParameterClassString(pc));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetParameterClassString(pc));
         }
 
         public static ProfileType GetProfile(string profile)
         {
-            return CgNativeMethods.cgGetProfile(profile);
+            return NativeMethods.cgGetProfile(profile);
         }
 
-        public static string GetProfileString(ProfileType profile)
+        public static string GetProfile(ProfileType profile)
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetProfileString(profile));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetProfileString(profile));
+        }
+
+        public static ProfileType GetProfileSibling(ProfileType profile, Domain domain)
+        {
+            return NativeMethods.cgGetProfileSibling(profile, domain);
         }
 
         public static ResourceType GetResource(string resourceName)
         {
-            return CgNativeMethods.cgGetResource(resourceName);
+            return NativeMethods.cgGetResource(resourceName);
         }
 
-        public static string GetResourceString(ResourceType resource)
+        public static string GetResource(ResourceType resource)
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetResourceString(resource));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetResourceString(resource));
         }
 
         public static string GetString(CgAll sname)
         {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetString(sname));
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetString(sname));
         }
 
         public static ParameterType GetType(string typeString)
         {
-            return CgNativeMethods.cgGetType(typeString);
+            return NativeMethods.cgGetType(typeString);
+        }
+
+        public static string GetType(ParameterType type)
+        {
+            return Marshal.PtrToStringAnsi(NativeMethods.cgGetTypeString(type));
         }
 
         public static ParameterType GetTypeBase(ParameterType type)
         {
-            return CgNativeMethods.cgGetTypeBase(type);
+            return NativeMethods.cgGetTypeBase(type);
         }
 
         public static ParameterClass GetTypeClass(ParameterType type)
         {
-            return CgNativeMethods.cgGetTypeClass(type);
-        }
-
-        public static string GetTypeString(ParameterType type)
-        {
-            return Marshal.PtrToStringAnsi(CgNativeMethods.cgGetTypeString(type));
+            return NativeMethods.cgGetTypeClass(type);
         }
 
         #endregion Public Static Methods

CgNet/CgNativeMethods.cs

-/*
-MIT License
-Copyright �2003-2006 Tao Framework Team
-http://www.taoframework.com
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
-namespace CgNet
-{
-    using System;
-    using System.Runtime.InteropServices;
-    using System.Security;
-
-    /// <summary>
-    ///     Cg core runtime binding for .NET, implementing Cg 1.4.1.
-    /// </summary>
-    /// <remarks>
-    ///     Binds functions and definitions in cg.dll or libcg.so.
-    /// </remarks>
-    internal static class CgNativeMethods
-    {
-        #region Fields
-
-        internal const int CgFalse = 0;
-        internal const int CgTrue = 1;
-
-        private const string CgNativeLibrary = "cg.dll";
-        private const CallingConvention Convention = CallingConvention.Cdecl;
-
-        #endregion Fields
-
-        #region Delegates
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        public delegate void CgIncludeCallbackFunc(IntPtr context, string filename);
-
-        /// <summary>
-        ///    
-        /// </summary>
-        // typedef void (*CGerrorCallbackFunc)(void);
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void CgErrorCallbackFuncDelegate();
-
-        #endregion Delegates
-
-        #region Methods
-
-        #region Public Static Methods
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgAddStateEnumerant(IntPtr state, string name, int value);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        [return: MarshalAs(UnmanagedType.Bool)]
-        public static extern bool cgCallStateResetCallback(IntPtr stateassignment);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        [return: MarshalAs(UnmanagedType.Bool)]
-        public static extern bool cgCallStateSetCallback(IntPtr stateassignment);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        [return: MarshalAs(UnmanagedType.Bool)]
-        public static extern bool cgCallStateValidateCallback(IntPtr stateassignment);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCombinePrograms(int n, IntPtr[] progs);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCombinePrograms2(IntPtr exe1, IntPtr exe2);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCombinePrograms3(IntPtr exe1, IntPtr exe2, IntPtr exe3);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCombinePrograms4(IntPtr exe1, IntPtr exe2, IntPtr exe3, IntPtr exe4);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCombinePrograms5(IntPtr exe1, IntPtr exe2, IntPtr exe3, IntPtr exe4, IntPtr exe5);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgCompileProgram(IntPtr prog);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgConnectParameter(IntPtr from, IntPtr to);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCopyEffect(IntPtr effect);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCopyProgram(IntPtr program);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateArraySamplerState(IntPtr context, string name, ParameterType type, int nelems);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateArrayState(IntPtr context, string name, ParameterType type, int nelems);
-
-        // CG_API CGbuffer CGENTRY cgCreateBuffer(CGcontext context, int size, const void *data, CGbufferusage bufferUsage);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateBuffer(IntPtr context, int size, IntPtr data, BufferUsage bufferUsage);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateContext();
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateEffect(IntPtr context, string code, string[] args);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateEffectAnnotation(IntPtr effect, string name, ParameterType type);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateEffectFromFile(IntPtr context, string filename, string[] args);
-
-        //CG_API CGparameter CGENTRY cgCreateEffectParameter(CGeffect effect, const char *name, CGtype type);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateEffectParameter(IntPtr context, string name, ParameterType type);
-
-        //CG_API CGparameter CGENTRY cgCreateEffectParameterArray(CGeffect effect, const char *name, CGtype type, int length);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateEffectParameterArray(IntPtr effect, string name, ParameterType type, int length);
-
-        //CG_API CGparameter CGENTRY cgCreateEffectParameterMultiDimArray(CGeffect effect, const char *name, CGtype type, int dim, const int *lengths);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateEffectParameterMultiDimArray(IntPtr effect, string name, ParameterType type, int dim, int[] lengths);
-
-        //CG_API CGobj CGENTRY cgCreateObj(CGcontext context, CGenum program_type, const char *source, CGprofile profile, const char **args);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateObj(IntPtr context, ProgramType programType, string source, ProfileType profile, string[] args);
-
-        //CG_API CGobj CGENTRY cgCreateObjFromFile(CGcontext context, CGenum program_type, const char *source_file, CGprofile profile, const char **args);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateObjFromFile(IntPtr context, ProgramType programType, string sourceFile, ProfileType profile, string[] args);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateParameter(IntPtr context, ParameterType type);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateParameterAnnotation(IntPtr param, string name, ParameterType type);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateParameterArray(IntPtr context, ParameterType type, int length);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateParameterMultiDimArray(IntPtr context, ParameterType type, int dim, [In] int[] lengths);
-
-        //CG_API CGpass CGENTRY cgCreatePass(CGtechnique tech, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreatePass(IntPtr tech, string name);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreatePassAnnotation(IntPtr pass, string name, ParameterType type);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateProgram(IntPtr context, ProgramType type, string source, ProfileType profile, string entry, string[] args);
-
-        // CG_API CGannotation CGENTRY cgCreateProgramAnnotation(CGprogram program, const char *name, CGtype type);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateProgramAnnotation(IntPtr annotation, string name, ParameterType type);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateProgramFromEffect(IntPtr effect, ProfileType profile, string entry, string[] args);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateProgramFromFile(IntPtr context, ProgramType type, string file, ProfileType profile, string entry, string[] args);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateSamplerState(IntPtr context, string name, ParameterType type);
-
-        //CG_API CGstateassignment CGENTRY cgCreateSamplerStateAssignment(CGparameter param, CGstate state);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateSamplerStateAssignment(IntPtr pass, IntPtr state);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateState(IntPtr context, string name, ParameterType type);
-
-        //CG_API CGstateassignment CGENTRY cgCreateStateAssignment(CGpass pass, CGstate state);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateStateAssignment(IntPtr pass, IntPtr state);
-
-        //CG_API CGstateassignment CGENTRY cgCreateStateAssignmentIndex(CGpass pass, CGstate state, int index);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateStateAssignmentIndex(IntPtr pass, IntPtr state, int index);
-
-        //CG_API CGtechnique CGENTRY cgCreateTechnique(CGeffect effect, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateTechnique(IntPtr effect, string name);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgCreateTechniqueAnnotation(IntPtr tech, string name, ParameterType type);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgDestroyBuffer(IntPtr buffer);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgDestroyContext(IntPtr context);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgDestroyEffect(IntPtr effect);
-
-        //    CG_API void CGENTRY cgDestroyObj(CGobj obj);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgDestroyObj(IntPtr obj);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgDestroyParameter(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgDestroyProgram(IntPtr program);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgDisconnectParameter(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgEvaluateProgram(IntPtr prog, float[] f, int ncomps, int nx, int ny, int nz);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetAnnotationName(IntPtr annotation);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterType cgGetAnnotationType(IntPtr annotation);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetArrayDimension(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetArrayParameter(IntPtr aparam, int index);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetArraySize(IntPtr param, int dimension);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetArrayTotalSize(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterType cgGetArrayType(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern AutoCompileMode cgGetAutoCompile(IntPtr context);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern Behavior cgGetBehavior(string behaviorString);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetBehaviorString(Behavior behavior);
-
-        // const CGbool * cgGetBoolAnnotationValues( CGannotation ann, int * nvalues );
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetBoolAnnotationValues(IntPtr annotation, out int nvalues);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        [Obsolete]
-        public static extern int[] cgGetBooleanAnnotationValues(IntPtr annotation, out int[] nvalues);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetBoolStateAssignmentValues(IntPtr stateassignment, out int nVals);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetBufferSize(IntPtr buffer);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern CgIncludeCallbackFunc cgGetCompilerIncludeCallback(IntPtr context);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetConnectedParameter(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetConnectedStateAssignmentParameter(IntPtr sa);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetConnectedToParameter(IntPtr param, int index);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern Behavior cgGetContextBehavior(IntPtr context);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetDependentAnnotationParameter(IntPtr annotation, int index);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetDependentProgramArrayStateAssignmentParameter(IntPtr sa, int index);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetDependentStateAssignmentParameter(IntPtr stateassignment, int index);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern Domain cgGetDomain(string domainString);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetDomainString(Domain domain);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetEffectContext(IntPtr effect);
-
-        //        CG_API const char * CGENTRY cgGetEffectName(CGeffect effect);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetEffectName(IntPtr effect);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetEffectParameterBuffer(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="effect"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGparameter cgGetEffectParameterBySemantic(CGeffect, const char *);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetEffectParameterBySemantic(IntPtr effect, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="enumString"></param>
-        /// <returns></returns>
-        // CGDLL_API CGenum cgGetEnum(const char *enum_string);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetEnum(string enumString);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="en"></param>
-        /// <returns></returns>
-        // CGDLL_API const char *cgGetEnumString(CGenum en);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetEnumString(int en);
-
-        /// <summary>
-        ///    Returns an error enum if an error has occured in the last Cg method call.
-        /// </summary>
-        /// <returns>Error enum.</returns>
-        //CGDLL_API CGerror cgGetError(void);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ErrorType cgGetError();
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <returns></returns>
-        // CGDLL_API CGerrorCallbackFunc cgGetErrorCallback(void);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern CgErrorCallbackFuncDelegate cgGetErrorCallback();
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="data"></param>
-        /// <returns></returns>
-        // CGDLL_API CGerrorHandlerFunc cgGetErrorHandler(void **data);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern Cg.CgErrorHandlerFuncDelegate cgGetErrorHandler(IntPtr data);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetErrorString(ErrorType error);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API CGparameter cgGetFirstDependentParameter(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstDependentParameter(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <returns></returns>
-        // CGDLL_API CGeffect cgGetFirstEffect(CGcontext);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstEffect(IntPtr context);
-
-        //CG_API CGannotation CGENTRY cgGetFirstEffectAnnotation(CGeffect effect);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstEffectAnnotation(IntPtr effect);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="effect"></param>
-        /// <returns></returns>
-        // CGDLL_API CGparameter cgGetFirstEffectParameter(CGeffect);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstEffectParameter(IntPtr effect);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <returns></returns>
-        // CGDLL_API CGerror cgGetFirstError(void);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ErrorType cgGetFirstError();
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="effect"></param>
-        /// <returns></returns>
-        // CGDLL_API CGparameter cgGetFirstLeafEffectParameter(CGeffect);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstLeafEffectParameter(IntPtr effect);
-
-        /// <summary>
-        ///    Used to get the first leaf parameter from the specified program.
-        /// </summary>
-        /// <remarks>
-        ///    Leaf params read into params that are structs as well, eliminating the need to explictly 
-        ///    determine if the param is a struct or other type.
-        /// </remarks>
-        /// <param name="program">
-        ///    Handle to the program to query.
-        /// </param>
-        /// <param name="nameSpace">
-        ///    Namespace in which to query for the params (usually CG_PROGRAM).
-        /// </param>
-        /// <returns>
-        ///    Handle to the first Cg parameter in the specified program.
-        /// </returns>
-        // CGDLL_API CGparameter cgGetFirstLeafParameter(CGprogram prog, CGenum name_space);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstLeafParameter(IntPtr program, NameSpace nameSpace);
-
-        /// <summary>
-        /// Gets the first parameter in specified program.
-        /// </summary>
-        /// <param name="prog">The program to retreive the first program from.</param>
-        /// <param name="nameSpace">Namespace of the parameter to iterate through.</param>
-        /// <returns>First parameter in specified program.</returns>
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstParameter(IntPtr prog, NameSpace nameSpace);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API CGannotation cgGetFirstParameterAnnotation(CGparameter);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstParameterAnnotation(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="technique"></param>
-        /// <returns></returns>
-        // CGDLL_API CGpass cgGetFirstPass(CGtechnique);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstPass(IntPtr technique);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="pass"></param>
-        /// <returns></returns>
-        // CGDLL_API CGannotation cgGetFirstPassAnnotation(CGpass);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstPassAnnotation(IntPtr pass);
-
-        /// <summary>
-        ///     Gets the first program in a context.
-        /// </summary>
-        /// <param name="context">
-        ///     The context to retreive first program from.
-        /// </param>
-        /// <returns>
-        ///     The program or null if no programs available.
-        /// </returns>
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstProgram(IntPtr context);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstProgramAnnotation(IntPtr prog);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <returns></returns>
-        // CGDLL_API CGstate cgGetFirstSamplerState(CGcontext);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstSamplerState(IntPtr context);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API CGstateassignment cgGetFirstSamplerStateAssignment(CGparameter);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstSamplerStateAssignment(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <returns></returns>
-        // CGDLL_API CGstate cgGetFirstState(CGcontext);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstState(IntPtr context);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="pass"></param>
-        /// <returns></returns>
-        // CGDLL_API CGstateassignment cgGetFirstStateAssignment(CGpass);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstStateAssignment(IntPtr pass);
-
-        /// <summary>
-        /// Gets the first child parameter in a struct parameter.
-        /// </summary>
-        /// <param name="param">The struct parameter to get child parameter from.</param>
-        /// <returns>First child parameter in specified struct parameter.</returns>
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstStructParameter(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="effect"></param>
-        /// <returns></returns>
-        // CGDLL_API CGtechnique cgGetFirstTechnique(CGeffect);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstTechnique(IntPtr effect);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="technique"></param>
-        /// <returns></returns>
-        // CGDLL_API CGannotation cgGetFirstTechniqueAnnotation(CGtechnique);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetFirstTechniqueAnnotation(IntPtr technique);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="annotation"></param>
-        /// <param name="nvalues"></param>
-        /// <returns></returns>
-        // CGDLL_API const float *cgGetFloatAnnotationValues(CGannotation, int *nvalues);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern float[] cgGetFloatAnnotationValues(IntPtr annotation, out int nvalues);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="stateassignment"></param>
-        /// <param name="nVals"></param>
-        /// <returns></returns>
-        // CGDLL_API const float *cgGetFloatStateAssignmentValues(CGstateassignment, int *nVals);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern float[] cgGetFloatStateAssignmentValues(IntPtr stateassignment, out int nVals);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="annotation"></param>
-        /// <param name="nvalues"></param>
-        /// <returns></returns>
-        // CGDLL_API const int *cgGetIntAnnotationValues(CGannotation, int *nvalues);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int[] cgGetIntAnnotationValues(IntPtr annotation, out int nvalues);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="stateassignment"></param>
-        /// <param name="nVals"></param>
-        /// <returns></returns>
-        // CGDLL_API const int *cgGetIntStateAssignmentValues(CGstateassignment, int *nVals);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int[] cgGetIntStateAssignmentValues(IntPtr stateassignment, out int nVals);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetLastErrorString(out ErrorType error);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetLastListing(IntPtr context);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern LockingPolicy cgGetLockingPolicy();
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="matrix"></param>
-        // CGDLL_API void cgGetMatrixParameterdc(CGparameter param, double *matrix);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgGetMatrixParameterdc(IntPtr param, IntPtr matrix);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="matrix"></param>
-        // CGDLL_API void cgGetMatrixParameterdr(CGparameter param, double *matrix);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgGetMatrixParameterdr(IntPtr param, IntPtr matrix);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="matrix"></param>
-        // CGDLL_API void cgGetMatrixParameterfc(CGparameter param, float *matrix);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgGetMatrixParameterfc(IntPtr param, IntPtr matrix);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="matrix"></param>
-        // CGDLL_API void cgGetMatrixParameterfr(CGparameter param, float *matrix);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgGetMatrixParameterfr(IntPtr param, IntPtr matrix);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="matrix"></param>
-        // CGDLL_API void cgGetMatrixParameteric(CGparameter param, int *matrix);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgGetMatrixParameteric(IntPtr param, IntPtr matrix);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="matrix"></param>
-        // CGDLL_API void cgGetMatrixParameterir(CGparameter param, int *matrix);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern void cgGetMatrixParameterir(IntPtr param, IntPtr matrix);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern Order cgGetMatrixParameterOrder(IntPtr param);
-
-        //CG_API void CGENTRY cgGetMatrixSize(CGtype type, int *nrows, int *ncols);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterType cgGetMatrixSize(ParameterType type, out int nrows, out int ncols);
-
-        //CG_API CGeffect CGENTRY cgGetNamedEffect(CGcontext context, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedEffect(IntPtr context, string name);
-
-        //CG_API CGannotation CGENTRY cgGetNamedEffectAnnotation(CGeffect effect, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedEffectAnnotation(IntPtr effect, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="effect"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGparameter cgGetNamedEffectParameter(CGeffect, const char *);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedEffectParameter(IntPtr effect, string name);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedParameter(IntPtr program, string parameter);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGannotation cgGetNamedParameterAnnotation(CGparameter, const char *);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedParameterAnnotation(IntPtr param, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="technique"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGpass cgGetNamedPass(CGtechnique, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedPass(IntPtr technique, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="pass"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGannotation cgGetNamedPassAnnotation(CGpass, const char *);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedPassAnnotation(IntPtr pass, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="prog"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGannotation cgGetNamedProgramAnnotation(CGprogram, const char *);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedProgramAnnotation(IntPtr prog, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="prog"></param>
-        /// <param name="nameSpace"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGparameter cgGetNamedProgramParameter(CGprogram prog,  CGenum name_space,  const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedProgramParameter(IntPtr prog, NameSpace nameSpace, string name);
-
-        // CGDLL_API CGstate cgGetNamedSamplerState(CGcontext, string name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedSamplerState(IntPtr context, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGstateassignment cgGetNamedSamplerStateAssignment(CGparameter, const char *);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedSamplerStateAssignment(IntPtr param, string name);
-
-        // CGDLL_API CGstate cgGetNamedState(CGcontext, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedState(IntPtr context, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="pass"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGstateassignment cgGetNamedStateAssignment(CGpass, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedStateAssignment(IntPtr pass, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGparameter cgGetNamedStructParameter(CGparameter param, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedStructParameter(IntPtr param, string name);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedSubParameter(IntPtr param, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="effect"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGtechnique cgGetNamedTechnique(CGeffect, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedTechnique(IntPtr effect, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="technique"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGannotation cgGetNamedTechniqueAnnotation(CGtechnique, const char *);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNamedTechniqueAnnotation(IntPtr technique, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="handle"></param>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        // CGDLL_API CGtype cgGetNamedUserType(CGhandle handle, const char *name);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterType cgGetNamedUserType(IntPtr handle, string name);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="annotation"></param>
-        /// <returns></returns>
-        // CGDLL_API CGannotation cgGetNextAnnotation(CGannotation);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNextAnnotation(IntPtr annotation);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="effect"></param>
-        /// <returns></returns>
-        // CGDLL_API CGeffect cgGetNextEffect(CGeffect);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNextEffect(IntPtr effect);
-
-        /// <summary>
-        ///    Gets a handle to the leaf parameter directly following the specified param.
-        /// </summary>
-        /// <param name="currentParam">Current Cg parameter.</param>
-        /// <returns>Handle to the next param after the current program, null if the current is the last param.</returns>
-        // CGDLL_API CGparameter cgGetNextLeafParameter(CGparameter current);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNextLeafParameter(IntPtr currentParam);
-
-        /// <summary>
-        /// Iterates to next parameter in program.
-        /// </summary>
-        /// <param name="currentParam">The current parameter.</param>
-        /// <returns>The next parameter in the program's internal sequence of parameters.</returns>
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNextParameter(IntPtr currentParam);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="pass"></param>
-        /// <returns></returns>
-        // CGDLL_API CGpass cgGetNextPass(CGpass);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNextPass(IntPtr pass);
-
-        /// <summary>
-        ///     Iterate trough programs in a context.
-        /// </summary>
-        /// <param name="current">
-        ///     Current program.
-        /// </param>
-        /// <returns>
-        ///     Next program in context's internal sequence of programs.
-        /// </returns>
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNextProgram(IntPtr current);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="state"></param>
-        /// <returns></returns>
-        // CGDLL_API CGstate cgGetNextState(CGstate);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNextState(IntPtr state);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="stateassignment"></param>
-        /// <returns></returns>
-        // CGDLL_API CGstateassignment cgGetNextStateAssignment(CGstateassignment);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNextStateAssignment(IntPtr stateassignment);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="technique"></param>
-        /// <returns></returns>
-        // CGDLL_API CGtechnique cgGetNextTechnique(CGtechnique);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetNextTechnique(IntPtr technique);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetNumConnectedToParameters(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetNumConnectedToParameters(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="annotation"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetNumDependentAnnotationParameters(CGannotation);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetNumDependentAnnotationParameters(IntPtr annotation);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetNumDependentProgramArrayStateAssignmentParameters(IntPtr sa);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="stateassignment"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetNumDependentStateAssignmentParameters(CGstateassignment);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetNumDependentStateAssignmentParameters(IntPtr stateassignment);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="type"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetNumParentTypes(CGtype type);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetNumParentTypes(ParameterType type);
-
-        //CG_API int CGENTRY cgGetNumProgramDomains(CGprogram program);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetNumProgramDomains(IntPtr program);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetNumStateEnumerants(IntPtr state);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetNumSupportedProfiles();
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="handle"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetNumUserTypes(CGhandle handle);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetNumUserTypes(IntPtr handle);
-
-        /// <summary>
-        /// Gets a parameter's base resource.
-        /// </summary>
-        /// <param name="param">Parameter to retreive base resource from</param>
-        /// <returns>Base resource of a given parameter.</returns>
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ResourceType cgGetParameterBaseResource(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API CGtype cgGetParameterBaseType(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterType cgGetParameterBaseType(IntPtr param);
-
-        //  CG_API int CGENTRY cgGetParameterBufferIndex(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterBufferIndex(IntPtr param);
-
-        // CG_API int CGENTRY cgGetParameterBufferOffset(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterBufferOffset(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API CGparameterclass cgGetParameterClass(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterClass cgGetParameterClass(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterClass cgGetParameterClassEnum(string pString);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetParameterClassString(ParameterClass pc);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetParameterColumns(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterColumns(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API CGcontext cgGetParameterContext(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetParameterContext(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterDefaultValuedc(IntPtr param, int nelements, double[] vals);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterDefaultValuedr(IntPtr param, int nelements, double[] vals);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterDefaultValuefc(IntPtr param, int nelements, float[] vals);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterDefaultValuefr(IntPtr param, int nelements, float[] vals);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterDefaultValueic(IntPtr param, int nelements, int[] vals);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterDefaultValueir(IntPtr param, int nelements, int[] vals);
-
-        /// <summary>
-        ///    Gets the direction of this parameter, i.e. CG_IN, CG_OUT, CG_INOUT.
-        /// </summary>
-        /// <param name="param">Id of the parameter to query.</param>
-        /// <returns>Enum value representing the parameter's direction.</returns>
-        // CGDLL_API CGenum cgGetParameterDirection(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterDirection cgGetParameterDirection(IntPtr param);
-
-        //CG_API CGeffect CGENTRY cgGetParameterEffect(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetParameterEffect(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetParameterIndex(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterIndex(IntPtr param);
-
-        /// <summary>
-        ///    Gets the name of the specified program.
-        /// </summary>
-        /// <param name="param">Handle to the program to query.</param>
-        /// <returns>IntPtr that must be converted to an Ansi string via Marshal.PtrToStringAnsi.</returns>
-        // CGDLL_API const char *cgGetParameterName(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetParameterName(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API CGtype cgGetParameterNamedType(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterType cgGetParameterNamedType(IntPtr param);
-
-        /// <summary>
-        /// Returns an integer that represents the position of a parameter when it was declared within the Cg program.
-        /// </summary>
-        /// <param name="param">Parameter to retreive it's ordinal number.</param>
-        /// <returns>Parameter's ordinal number.</returns>
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterOrdinalNumber(IntPtr param);
-
-        /// <summary>
-        /// Gets program that specified parameter belongs to.
-        /// </summary>
-        /// <param name="param">Parameter to retreive it's parent program.</param>
-        /// <returns>A program given parameter belongs to.</returns>
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetParameterProgram(IntPtr param);
-
-        /// <summary>
-        /// Gets a parameter's resource.
-        /// </summary>
-        /// <param name="param">Parameter to retreive resource from</param>
-        /// <returns>Resource of a given parameter.</returns>
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ResourceType cgGetParameterResource(IntPtr param);
-
-        /// <summary>
-        ///    Retrieves the index of the specifed parameter according to its type and variability.
-        /// </summary>
-        /// <remarks>
-        ///    For example, if the resource for a given parameter is CG_TEXCOORD7,
-        ///    cgGetParameterResourceIndex() returns 7.  Also, for uniform params, it equates
-        ///    to the constant index that will be used in the resulting program.
-        /// </remarks>
-        /// <param name="param">
-        ///    Handle of the param to query.
-        /// </param>
-        /// <returns>
-        ///    Index of the specified parameter according to its type and variability.
-        /// </returns>
-        // CGDLL_API unsigned long cgGetParameterResourceIndex(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern uint cgGetParameterResourceIndex(IntPtr param);
-
-        //CG_API const char * CGENTRY cgGetParameterResourceName(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetParameterResourceName(IntPtr param);
-
-        //CG_API long CGENTRY cgGetParameterResourceSize(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterResourceSize(IntPtr param);
-
-        // CG_API CGtype CGENTRY cgGetParameterResourceType(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterType cgGetParameterResourceType(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetParameterRows(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterRows(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetParameterSemantic(IntPtr param);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterSettingMode cgGetParameterSettingMode(IntPtr context);
-
-        /// <summary>
-        ///    Gets the data type of the specified parameter.
-        /// </summary>
-        /// <param name="param">Id of the parameter to query.</param>
-        /// <returns>Enum value representing the parameter's data type.</returns>
-        // CGDLL_API CGtype cgGetParameterType(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterType cgGetParameterType(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="n"></param>
-        /// <param name="vals"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetParameterValuedc(CGparameter param, int n, double *vals);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterValuedc(IntPtr param, int n, IntPtr vals);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="n"></param>
-        /// <param name="vals"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetParameterValuedr(CGparameter param, int n, double *vals);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterValuedr(IntPtr param, int n, IntPtr vals);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="n"></param>
-        /// <param name="vals"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetParameterValuefc(CGparameter param, int n, float *vals);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterValuefc(IntPtr param, int n, IntPtr vals);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="n"></param>
-        /// <param name="vals"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetParameterValuefr(CGparameter param, int n, float *vals);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterValuefr(IntPtr param, int n, IntPtr vals);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="n"></param>
-        /// <param name="vals"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetParameterValueic(CGparameter param, int n, int *vals);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterValueic(IntPtr param, int n, IntPtr vals);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="param"></param>
-        /// <param name="n"></param>
-        /// <param name="vals"></param>
-        /// <returns></returns>
-        // CGDLL_API int cgGetParameterValueir(CGparameter param, int n, int *vals);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern int cgGetParameterValueir(IntPtr param, int n, IntPtr vals);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        [Obsolete]
-        public static extern double[] cgGetParameterValues(IntPtr param, int valueType, int[] nvalues);
-
-        /// <summary>
-        ///    Gets the variability of the specified param (i.e, uniform, varying, etc).
-        /// </summary>
-        /// <param name="param">Handle of the program to query.</param>
-        /// <returns>Enum stating the variability of the program.</returns>
-        // CGDLL_API CGenum cgGetParameterVariability(CGparameter param);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern Variability cgGetParameterVariability(IntPtr param);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="type"></param>
-        /// <param name="index"></param>
-        /// <returns></returns>
-        // CGDLL_API CGtype cgGetParentType(CGtype type, int index);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern ParameterType cgGetParentType(ParameterType type, int index);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="pass"></param>
-        /// <returns></returns>
-        // CGDLL_API const char *cgGetPassName(CGpass);
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetPassName(IntPtr pass);
-
-        [DllImport(CgNativeLibrary, CallingConvention = Convention)]
-        [SuppressUnmanagedCodeSecurity]
-        public static extern IntPtr cgGetPassProgram(IntPtr pass, Domain domain);
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="pass"></param>