Commits

Tobias Bohnen committed e9e7370

* fixed AVE with empty params arrays

  • Participants
  • Parent commits db42f67

Comments (0)

Files changed (3)

CgNet.SlimDX/Properties/AssemblyInfo.cs

-#region Using directives
-
-using System;
+using System;
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-#endregion
-
-// General Information about an assembly is controlled through the following 
+// General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("CgNet.SlimDX")]
 //
 // Major.Minor.Build.Revision
 //
-// You can specify all the values or you can use the default the Revision and 
+// You can specify all the values or you can use the default the Revision and
 // Build Numbers by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.*")]
 
         public Effect CreateEffect(string code, params string[] args)
         {
+            if (args != null && args.Length == 0)
+            {
+                args = null;
+            }
+
             var ptr = NativeMethods.cgCreateEffect(this.Handle, code, args);
             return ptr == IntPtr.Zero ? null : new Effect(ptr, true);
         }
 
         public Effect CreateEffectFromFile(string filename, params string[] args)
         {
+            if (args != null && args.Length == 0)
+            {
+                args = null;
+            }
+
             var ptr = NativeMethods.cgCreateEffectFromFile(this.Handle, filename, args);
             return ptr == IntPtr.Zero ? null : new Effect(ptr, true);
         }
 
         public Obj CreateObj(ProgramType programType, string source, ProfileType profile, params string[] args)
         {
+            if (args != null && args.Length == 0)
+            {
+                args = null;
+            }
+
             var ptr = NativeMethods.cgCreateObj(this.Handle, programType, source, profile, args);
             return ptr == IntPtr.Zero ? null : new Obj(ptr, true);
         }
 
         public Obj CreateObjFromFile(ProgramType programType, string sourceFile, ProfileType profile, params string[] args)
         {
+            if (args != null && args.Length == 0)
+            {
+                args = null;
+            }
+
             var ptr = NativeMethods.cgCreateObjFromFile(this.Handle, programType, sourceFile, profile, args);
             return ptr == IntPtr.Zero ? null : new Obj(ptr, true);
         }
 
         public Program CreateProgram(ProgramType type, string source, ProfileType profile, string entry, params string[] args)
         {
+            if (args != null && args.Length == 0)
+            {
+                args = null;
+            }
+
             var ptr = NativeMethods.cgCreateProgram(this.Handle, type, source, profile, entry, args);
             return ptr == IntPtr.Zero ? null : new Program(ptr, true)
             {
 
         public Program CreateProgramFromFile(ProgramType type, string file, ProfileType profile, string entry, params string[] args)
         {
+            if (args != null && args.Length == 0)
+            {
+                args = null;
+            }
+
             var ptr = NativeMethods.cgCreateProgramFromFile(this.Handle, type, file, profile, entry, args);
             return ptr == IntPtr.Zero ? null : new Program(ptr, true)
             {
 
         public Program CreateProgram(ProfileType profile, string entry, params string[] args)
         {
+            if (args != null && args.Length == 0)
+            {
+                args = null;
+            }
+
             var ptr = NativeMethods.cgCreateProgramFromEffect(this.Handle, profile, entry, args);
             return ptr == IntPtr.Zero ? null : new Program(ptr, true);
         }