[OpenTK] Added IPlatformFactory.RegisterResource()

This commit is contained in:
thefiddler 2014-07-23 14:34:52 +02:00
parent 5d66aaa034
commit ab75ca05c4
3 changed files with 15 additions and 12 deletions

View file

@ -165,6 +165,11 @@ namespace OpenTK.Platform
#pragma warning restore 612,618 #pragma warning restore 612,618
} }
public void RegisterResource(IDisposable resource)
{
default_implementation.RegisterResource(resource);
}
class UnsupportedPlatform : PlatformFactoryBase class UnsupportedPlatform : PlatformFactoryBase
{ {
#region Fields #region Fields

View file

@ -55,5 +55,7 @@ namespace OpenTK.Platform
[Obsolete] [Obsolete]
Input.IJoystickDriver CreateLegacyJoystickDriver(); Input.IJoystickDriver CreateLegacyJoystickDriver();
void RegisterResource(IDisposable resource);
} }
} }

View file

@ -52,18 +52,6 @@ namespace OpenTK.Platform
{ {
} }
#region Protected Members
protected void RegisterResource(IDisposable resource)
{
lock (sync)
{
Resources.Add(resource);
}
}
#endregion
#region IPlatformFactory Members #region IPlatformFactory Members
public abstract INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device); 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(); return new LegacyJoystickDriver();
} }
public void RegisterResource(IDisposable resource)
{
lock (sync)
{
Resources.Add(resource);
}
}
#endregion #endregion
#region IDisposable implementation #region IDisposable implementation