Tobias Bohnen avatar Tobias Bohnen committed e9e7370

* fixed AVE with empty params arrays

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);
         }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.