From ab75ca05c49f66941495c221d6269ce44b0552b9 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Wed, 23 Jul 2014 14:34:52 +0200 Subject: [PATCH] [OpenTK] Added IPlatformFactory.RegisterResource() --- Source/OpenTK/Platform/Factory.cs | 5 +++++ Source/OpenTK/Platform/IPlatformFactory.cs | 2 ++ Source/OpenTK/Platform/PlatformFactoryBase.cs | 20 ++++++++----------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Source/OpenTK/Platform/Factory.cs b/Source/OpenTK/Platform/Factory.cs index 4e061e80..dcf4c97f 100644 --- a/Source/OpenTK/Platform/Factory.cs +++ b/Source/OpenTK/Platform/Factory.cs @@ -165,6 +165,11 @@ namespace OpenTK.Platform #pragma warning restore 612,618 } + public void RegisterResource(IDisposable resource) + { + default_implementation.RegisterResource(resource); + } + class UnsupportedPlatform : PlatformFactoryBase { #region Fields diff --git a/Source/OpenTK/Platform/IPlatformFactory.cs b/Source/OpenTK/Platform/IPlatformFactory.cs index 34effb7f..a126c13d 100644 --- a/Source/OpenTK/Platform/IPlatformFactory.cs +++ b/Source/OpenTK/Platform/IPlatformFactory.cs @@ -55,5 +55,7 @@ namespace OpenTK.Platform [Obsolete] Input.IJoystickDriver CreateLegacyJoystickDriver(); + + void RegisterResource(IDisposable resource); } } diff --git a/Source/OpenTK/Platform/PlatformFactoryBase.cs b/Source/OpenTK/Platform/PlatformFactoryBase.cs index 95f1a8fd..a97c2da9 100644 --- a/Source/OpenTK/Platform/PlatformFactoryBase.cs +++ b/Source/OpenTK/Platform/PlatformFactoryBase.cs @@ -52,18 +52,6 @@ namespace OpenTK.Platform { } - #region Protected Members - - protected void RegisterResource(IDisposable resource) - { - lock (sync) - { - Resources.Add(resource); - } - } - - #endregion - #region IPlatformFactory Members public abstract INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device); @@ -96,6 +84,14 @@ namespace OpenTK.Platform return new LegacyJoystickDriver(); } + public void RegisterResource(IDisposable resource) + { + lock (sync) + { + Resources.Add(resource); + } + } + #endregion #region IDisposable implementation