Commits

Tobias Bohnen  committed 16a4c0c

  • Participants
  • Parent commits 1dfd045

Comments (0)

Files changed (3)

File CgNet/CgEnums.cs

         ProgramProfile = 4107, /* GetProgramString                       */
     }
 
-    public enum Variabilty
+    public enum Variability
     {
+        Default = 4110,
         Varying = 4101,
         Uniform = 4102,
         Literal = 4118,

File CgNet/CgNativeMethods.cs

         // CGDLL_API unsigned long cgGetParameterResourceIndex(CGparameter param);
         [DllImport(CgNativeLibrary, CallingConvention = Convention)]
         [SuppressUnmanagedCodeSecurity]
-        internal static extern int cgGetParameterResourceIndex(IntPtr param);
+        internal static extern uint cgGetParameterResourceIndex(IntPtr param);
 
         //CG_API const char * CGENTRY cgGetParameterResourceName(CGparameter param);
         [DllImport(CgNativeLibrary, CallingConvention = Convention)]
         // CGDLL_API CGenum cgGetParameterVariability(CGparameter param);
         [DllImport(CgNativeLibrary, CallingConvention = Convention)]
         [SuppressUnmanagedCodeSecurity]
-        internal static extern Variabilty cgGetParameterVariability(IntPtr param);
+        internal static extern Variability cgGetParameterVariability(IntPtr param);
 
         /// <summary>
         /// 
         // CGDLL_API void cgSetParameterVariability(CGparameter param, CGenum vary);
         [DllImport(CgNativeLibrary, CallingConvention = Convention)]
         [SuppressUnmanagedCodeSecurity]
-        internal static extern void cgSetParameterVariability(IntPtr param, Variabilty vary);
+        internal static extern void cgSetParameterVariability(IntPtr param, Variability vary);
 
         /// <summary>
         /// 

File CgNet/Parameter.cs

         {
             get
             {
-                return CgNativeMethods.cgGetParameterResourceIndex(this.Handle);
+                return (int)CgNativeMethods.cgGetParameterResourceIndex(this.Handle);
             }
         }
 
 
             set
             {
+                if (string.IsNullOrEmpty(value))
+                {
+                    throw new ArgumentNullException("value");
+                }
+
                 CgNativeMethods.cgSetParameterSemantic(this.Handle, value);
             }
         }
             }
         }
 
-        public Variabilty Variability
+        public Variability Variability
         {
             get
             {
 
             set
             {
+                if (value != Variability.Literal && value != Variability.Uniform && value != Variability.Default)
+                {
+                    throw new ArgumentException("value must be CG_UNIFORM, CG_LITERAL, or CG_DEFAULT", "value");
+                }
+
                 CgNativeMethods.cgSetParameterVariability(this.Handle, value);
             }
         }