Use OpenTK.Minimal to stub out missing System.Drawing functionality

when building on Android or iOS platforms.
This commit is contained in:
Stefanos A 2013-10-12 05:06:54 +02:00
parent bb3156d185
commit 1130d988b0
3 changed files with 13 additions and 9 deletions

View file

@ -31,15 +31,17 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
#if !MINIMAL
using System.Drawing; using System.Drawing;
#endif
using System.Text; using System.Text;
using OpenTK.Graphics;
#if ANDROID || IPHONE || MINIMAL
using OpenTK.Minimal;
#endif
namespace OpenTK.Platform.MacOS namespace OpenTK.Platform.MacOS
{ {
using Carbon; using Carbon;
using Graphics; using Graphics = OpenTK.Minimal.Graphics;
class CarbonGLNative : INativeWindow class CarbonGLNative : INativeWindow
{ {
@ -755,11 +757,7 @@ namespace OpenTK.Platform.MacOS
int index; int index;
bitmap = new Bitmap(128, 128); bitmap = new Bitmap(128, 128);
#if MINIMAL using (Graphics g = Graphics.FromImage(bitmap))
using (OpenTK.Minimal.Graphics g = OpenTK.Minimal.Graphics.FromImage(bitmap))
#else
using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap))
#endif
{ {
g.DrawImage(icon.ToBitmap(), 0, 0, 128, 128); g.DrawImage(icon.ToBitmap(), 0, 0, 128, 128);
} }

View file

@ -29,7 +29,11 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
#if ANDROID || IPHONE || MINIMAL
using OpenTK.Minimal;
#else
using System.Drawing.Imaging; using System.Drawing.Imaging;
#endif
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using OpenTK; using OpenTK;
using OpenTK.Input; using OpenTK.Input;

View file

@ -8,8 +8,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !MINIMAL
using System.Drawing; using System.Drawing;
#if ANDROID || IPHONE || MINIMAL
using OpenTK.Minimal;
#else
using System.Drawing.Imaging; using System.Drawing.Imaging;
#endif #endif
using System.Text; using System.Text;