From 1130d988b08893788392adc502cf6080c18bff42 Mon Sep 17 00:00:00 2001 From: Stefanos A Date: Sat, 12 Oct 2013 05:06:54 +0200 Subject: [PATCH] Use OpenTK.Minimal to stub out missing System.Drawing functionality when building on Android or iOS platforms. --- Source/OpenTK/Platform/MacOS/CarbonGLNative.cs | 14 ++++++-------- Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs | 4 ++++ Source/OpenTK/Platform/X11/Functions.cs | 4 +++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Source/OpenTK/Platform/MacOS/CarbonGLNative.cs b/Source/OpenTK/Platform/MacOS/CarbonGLNative.cs index cfa5f16a..57a00146 100644 --- a/Source/OpenTK/Platform/MacOS/CarbonGLNative.cs +++ b/Source/OpenTK/Platform/MacOS/CarbonGLNative.cs @@ -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); } diff --git a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs index 7d3951bf..c8167039 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs @@ -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; diff --git a/Source/OpenTK/Platform/X11/Functions.cs b/Source/OpenTK/Platform/X11/Functions.cs index fdcbb183..4a22d660 100644 --- a/Source/OpenTK/Platform/X11/Functions.cs +++ b/Source/OpenTK/Platform/X11/Functions.cs @@ -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;