2009-02-22 10:43:35 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
namespace OpenTK.Platform
|
|
|
|
{
|
|
|
|
using Graphics;
|
|
|
|
|
|
|
|
static class Factory
|
|
|
|
{
|
|
|
|
static IPlatformFactory implementation;
|
|
|
|
|
|
|
|
static Factory()
|
|
|
|
{
|
|
|
|
if (Configuration.RunningOnWindows) implementation = new Windows.WinFactory();
|
|
|
|
else if (Configuration.RunningOnX11) implementation = new X11.X11Factory();
|
|
|
|
else if (Configuration.RunningOnMacOS) implementation = new MacOS.MacOSFactory();
|
|
|
|
else implementation = new UnsupportedPlatform();
|
|
|
|
}
|
|
|
|
|
|
|
|
internal static INativeGLWindow CreateNativeGLWindow()
|
|
|
|
{
|
|
|
|
return implementation.CreateGLNative();
|
|
|
|
}
|
|
|
|
|
|
|
|
internal static IGLControl CreateGLControl(GraphicsMode mode, GLControl owner)
|
|
|
|
{
|
|
|
|
return implementation.CreateGLControl(mode, owner);
|
|
|
|
}
|
|
|
|
|
|
|
|
internal static IDisplayDeviceDriver CreateDisplayDeviceDriver()
|
|
|
|
{
|
|
|
|
return implementation.CreateDisplayDeviceDriver();
|
|
|
|
}
|
|
|
|
|
2009-03-07 10:36:51 +00:00
|
|
|
internal static IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
|
2009-02-22 10:43:35 +00:00
|
|
|
{
|
2009-03-07 10:36:51 +00:00
|
|
|
return implementation.CreateGLContext(mode, window, shareContext, directRendering, major, minor, flags);
|
2009-02-22 10:43:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
internal static IGraphicsMode CreateGraphicsMode()
|
|
|
|
{
|
|
|
|
return implementation.CreateGraphicsMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
class UnsupportedPlatform : IPlatformFactory
|
|
|
|
{
|
|
|
|
#region IPlatformFactory Members
|
|
|
|
|
|
|
|
public INativeGLWindow CreateGLNative()
|
|
|
|
{
|
|
|
|
throw new PlatformNotSupportedException("Please, refer to http://www.opentk.com for more information.");
|
|
|
|
}
|
|
|
|
|
|
|
|
public IGLControl CreateGLControl(GraphicsMode mode, GLControl owner)
|
|
|
|
{
|
|
|
|
throw new PlatformNotSupportedException("Please, refer to http://www.opentk.com for more information.");
|
|
|
|
}
|
|
|
|
|
|
|
|
public IDisplayDeviceDriver CreateDisplayDeviceDriver()
|
|
|
|
{
|
|
|
|
throw new PlatformNotSupportedException("Please, refer to http://www.opentk.com for more information.");
|
|
|
|
}
|
|
|
|
|
2009-03-07 10:36:51 +00:00
|
|
|
public IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool DirectRendering, int major, int minor, GraphicsContextFlags flags)
|
2009-02-22 10:43:35 +00:00
|
|
|
{
|
|
|
|
throw new PlatformNotSupportedException("Please, refer to http://www.opentk.com for more information.");
|
|
|
|
}
|
|
|
|
|
|
|
|
public IGraphicsMode CreateGraphicsMode()
|
|
|
|
{
|
|
|
|
throw new PlatformNotSupportedException("Please, refer to http://www.opentk.com for more information.");
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|