From 6abca6ddf787aac2a43515e50e631ab43c5013e3 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Wed, 23 Jul 2014 14:35:33 +0200 Subject: [PATCH] [OpenTK] Register GraphicsContext and NativeWindow --- Source/OpenTK/Graphics/GraphicsContext.cs | 1 + Source/OpenTK/NativeWindow.cs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Graphics/GraphicsContext.cs b/Source/OpenTK/Graphics/GraphicsContext.cs index 1d6eb6bd..12a605f1 100644 --- a/Source/OpenTK/Graphics/GraphicsContext.cs +++ b/Source/OpenTK/Graphics/GraphicsContext.cs @@ -150,6 +150,7 @@ namespace OpenTK.Graphics implementation = factory.CreateGLContext(mode, window, shareContext, direct_rendering, major, minor, flags); handle_cached = ((IGraphicsContextInternal)implementation).Context; + factory.RegisterResource(this); } AddContext(this); diff --git a/Source/OpenTK/NativeWindow.cs b/Source/OpenTK/NativeWindow.cs index 9b731f53..6e892db9 100644 --- a/Source/OpenTK/NativeWindow.cs +++ b/Source/OpenTK/NativeWindow.cs @@ -102,7 +102,9 @@ namespace OpenTK this.options = options; this.device = device; - implementation = Factory.Default.CreateNativeWindow(x, y, width, height, title, mode, options, this.device); + IPlatformFactory factory = Factory.Default; + implementation = factory.CreateNativeWindow(x, y, width, height, title, mode, options, this.device); + factory.RegisterResource(this); if ((options & GameWindowFlags.Fullscreen) != 0) {