[OpenTK] Added IPlatformFactory.RegisterResource()
This commit is contained in:
parent
5d66aaa034
commit
ab75ca05c4
3 changed files with 15 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -55,5 +55,7 @@ namespace OpenTK.Platform
|
|||
|
||||
[Obsolete]
|
||||
Input.IJoystickDriver CreateLegacyJoystickDriver();
|
||||
|
||||
void RegisterResource(IDisposable resource);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue