From 050a93d4afb2d2ac08fd5defbe512f7776a29fc1 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Wed, 23 Jul 2014 14:36:09 +0200 Subject: [PATCH] [Mac] Resource registration moved to the facades --- Source/OpenTK/Platform/MacOS/MacOSFactory.cs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Source/OpenTK/Platform/MacOS/MacOSFactory.cs b/Source/OpenTK/Platform/MacOS/MacOSFactory.cs index 091c115..613d2d7 100644 --- a/Source/OpenTK/Platform/MacOS/MacOSFactory.cs +++ b/Source/OpenTK/Platform/MacOS/MacOSFactory.cs @@ -43,35 +43,34 @@ namespace OpenTK.Platform.MacOS internal const float ScrollFactor = 0.1f; internal static bool ExclusiveFullscreen = false; - readonly IInputDriver2 InputDriver = new HIDInput(); + readonly IInputDriver2 InputDriver; + + public MacOSFactory() + { + NSApplication.Initialize(); + InputDriver = new HIDInput(); + } #region IPlatformFactory Members public override INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) { - INativeWindow window = new CocoaNativeWindow(x, y, width, height, title, mode, options, device); - RegisterResource(window); - return window; + return new CocoaNativeWindow(x, y, width, height, title, mode, options, device); } public override IDisplayDeviceDriver CreateDisplayDeviceDriver() { - // Does not implement IDisposable return new QuartzDisplayDeviceDriver(); } public override IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) { - IGraphicsContext context = new CocoaContext(mode, window, shareContext, major, minor); - RegisterResource(context); - return context; + return new CocoaContext(mode, window, shareContext, major, minor); } public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) { - IGraphicsContext context = new CocoaContext(handle, window, shareContext, major, minor); - RegisterResource(context); - return context; + return new CocoaContext(handle, window, shareContext, major, minor); } public override GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext() -- 2.7.4