Use OpenTK.Minimal to stub out missing System.Drawing functionality
authorStefanos A <stapostol@gmail.com>
Sat, 12 Oct 2013 03:06:54 +0000 (05:06 +0200)
committerStefanos A <stapostol@gmail.com>
Sat, 12 Oct 2013 03:06:54 +0000 (05:06 +0200)
when building on Android or iOS platforms.

Source/OpenTK/Platform/MacOS/CarbonGLNative.cs
Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs
Source/OpenTK/Platform/X11/Functions.cs

index cfa5f16a2eabe3eefa8a4e8e2fa015e2e55b0ba8..57a00146b6d8aeb7f81f1c12a319dbed39d1c372 100644 (file)
@@ -31,15 +31,17 @@ using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Diagnostics;
-#if !MINIMAL
 using System.Drawing;
-#endif
 using System.Text;
+using OpenTK.Graphics;
+#if ANDROID || IPHONE || MINIMAL
+using OpenTK.Minimal;
+#endif
 
 namespace OpenTK.Platform.MacOS
 {
     using Carbon;
-    using Graphics;
+    using Graphics = OpenTK.Minimal.Graphics;
 
     class CarbonGLNative : INativeWindow
     {
@@ -755,11 +757,7 @@ namespace OpenTK.Platform.MacOS
                 int index;
                 
                 bitmap = new Bitmap(128, 128);
-#if MINIMAL
-                using (OpenTK.Minimal.Graphics g = OpenTK.Minimal.Graphics.FromImage(bitmap))
-#else
-                using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap))
-#endif
+                using (Graphics g = Graphics.FromImage(bitmap))
                 {
                     g.DrawImage(icon.ToBitmap(), 0, 0, 128, 128);
                 }
index 7d3951bf75a146757de2cf130b93964decfe510e..c8167039664b39a8bec666be08ee60fa3835182f 100644 (file)
@@ -29,7 +29,11 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Drawing;
+#if ANDROID || IPHONE || MINIMAL
+using OpenTK.Minimal;
+#else
 using System.Drawing.Imaging;
+#endif
 using System.Runtime.InteropServices;
 using OpenTK;
 using OpenTK.Input;
index fdcbb1834b4aab5d5c24b6baae4c1f3c15483c6b..4a22d660206b504df84a8e758dfec5f96fbaa691 100644 (file)
@@ -8,8 +8,10 @@
 
 using System;
 using System.Collections.Generic;
-#if !MINIMAL
 using System.Drawing;
+#if ANDROID || IPHONE || MINIMAL
+using OpenTK.Minimal;
+#else
 using System.Drawing.Imaging;
 #endif
 using System.Text;