diff --git a/Source/OpenTK/Platform/Factory.cs b/Source/OpenTK/Platform/Factory.cs index c7dbaed7..f4fcfb22 100644 --- a/Source/OpenTK/Platform/Factory.cs +++ b/Source/OpenTK/Platform/Factory.cs @@ -33,7 +33,7 @@ namespace OpenTK.Platform { using Graphics; - class Factory : IPlatformFactory + sealed class Factory : IPlatformFactory { #region Fields @@ -125,7 +125,12 @@ namespace OpenTK.Platform throw new PlatformNotSupportedException(error_string); } - public IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool DirectRendering, int major, int minor, GraphicsContextFlags flags) + public IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) + { + throw new PlatformNotSupportedException(error_string); + } + + public IGraphicsContext CreateESContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, int major, int minor, GraphicsContextFlags flags) { throw new PlatformNotSupportedException(error_string); } diff --git a/Source/OpenTK/Platform/IPlatformFactory.cs b/Source/OpenTK/Platform/IPlatformFactory.cs index 65209e34..0240aebf 100644 --- a/Source/OpenTK/Platform/IPlatformFactory.cs +++ b/Source/OpenTK/Platform/IPlatformFactory.cs @@ -41,7 +41,7 @@ namespace OpenTK.Platform IDisplayDeviceDriver CreateDisplayDeviceDriver(); - IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool DirectRendering, int major, int minor, GraphicsContextFlags flags); + IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags); OpenTK.Graphics.GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext(); diff --git a/Source/OpenTK/Platform/MacOS/MacOSFactory.cs b/Source/OpenTK/Platform/MacOS/MacOSFactory.cs index a3789a83..756a03aa 100644 --- a/Source/OpenTK/Platform/MacOS/MacOSFactory.cs +++ b/Source/OpenTK/Platform/MacOS/MacOSFactory.cs @@ -37,27 +37,27 @@ namespace OpenTK.Platform.MacOS { #region IPlatformFactory Members - public INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) + public virtual INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) { return new CarbonGLNative(x, y, width, height, title, mode, options, device); } - public IGLControl CreateGLControl(GraphicsMode mode, GLControl owner) + public virtual IGLControl CreateGLControl(GraphicsMode mode, GLControl owner) { return new CarbonGLControl(mode, owner); } - public IDisplayDeviceDriver CreateDisplayDeviceDriver() + public virtual IDisplayDeviceDriver CreateDisplayDeviceDriver() { return new QuartzDisplayDeviceDriver(); } - public IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool DirectRendering, int major, int minor, GraphicsContextFlags flags) + public virtual IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) { return new AglContext(mode, window, shareContext); } - public GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext() + public virtual GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext() { return (GraphicsContext.GetCurrentContextDelegate)delegate { @@ -65,12 +65,12 @@ namespace OpenTK.Platform.MacOS }; } - public IGraphicsMode CreateGraphicsMode() + public virtual IGraphicsMode CreateGraphicsMode() { return new MacOSGraphicsMode(); } - public OpenTK.Input.IKeyboardDriver CreateKeyboardDriver() + public virtual OpenTK.Input.IKeyboardDriver CreateKeyboardDriver() { throw new NotImplementedException(); } diff --git a/Source/OpenTK/Platform/Windows/WinFactory.cs b/Source/OpenTK/Platform/Windows/WinFactory.cs index 12c4a4d9..8aaf9353 100644 --- a/Source/OpenTK/Platform/Windows/WinFactory.cs +++ b/Source/OpenTK/Platform/Windows/WinFactory.cs @@ -32,33 +32,33 @@ using System.Text; namespace OpenTK.Platform.Windows { using Graphics; -using OpenTK.Input; + using OpenTK.Input; class WinFactory : IPlatformFactory { #region IPlatformFactory Members - public INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) + public virtual INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) { return new WinGLNative(x, y, width, height, title, options, device); } - public IGLControl CreateGLControl(GraphicsMode mode, GLControl owner) + public virtual IGLControl CreateGLControl(GraphicsMode mode, GLControl owner) { return new WinGLControl(mode, owner); } - public IDisplayDeviceDriver CreateDisplayDeviceDriver() + public virtual IDisplayDeviceDriver CreateDisplayDeviceDriver() { return new WinDisplayDeviceDriver(); } - public IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) + public virtual IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) { return new WinGLContext(mode, (WinWindowInfo)window, shareContext, major, minor, flags); } - public GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext() + public virtual GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext() { return (GraphicsContext.GetCurrentContextDelegate)delegate { @@ -66,12 +66,12 @@ using OpenTK.Input; }; } - public IGraphicsMode CreateGraphicsMode() + public virtual IGraphicsMode CreateGraphicsMode() { return new WinGraphicsMode(); } - public OpenTK.Input.IKeyboardDriver CreateKeyboardDriver() + public virtual OpenTK.Input.IKeyboardDriver CreateKeyboardDriver() { throw new NotImplementedException(); } diff --git a/Source/OpenTK/Platform/X11/X11Factory.cs b/Source/OpenTK/Platform/X11/X11Factory.cs index 63f55fba..6b1c43f0 100644 --- a/Source/OpenTK/Platform/X11/X11Factory.cs +++ b/Source/OpenTK/Platform/X11/X11Factory.cs @@ -10,27 +10,27 @@ namespace OpenTK.Platform.X11 { #region IPlatformFactory Members - public INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) + public virtual INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) { return new X11GLNative(x, y, width, height, title, mode, options, device); } - public IGLControl CreateGLControl(GraphicsMode mode, GLControl owner) + public virtual IGLControl CreateGLControl(GraphicsMode mode, GLControl owner) { return new X11GLControl(mode, owner); } - public IDisplayDeviceDriver CreateDisplayDeviceDriver() + public virtual IDisplayDeviceDriver CreateDisplayDeviceDriver() { return new X11XrandrDisplayDevice(); } - public IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool DirectRendering, int major, int minor, GraphicsContextFlags flags) + public virtual IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) { - return new X11GLContext(mode, window, shareContext, DirectRendering, major, minor, flags); + return new X11GLContext(mode, window, shareContext, directRendering, major, minor, flags); } - public OpenTK.Graphics.GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext() + public virtual OpenTK.Graphics.GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext() { return (GraphicsContext.GetCurrentContextDelegate)delegate { @@ -38,12 +38,12 @@ namespace OpenTK.Platform.X11 }; } - public IGraphicsMode CreateGraphicsMode() + public virtual IGraphicsMode CreateGraphicsMode() { return new X11GraphicsMode(); } - - public OpenTK.Input.IKeyboardDriver CreateKeyboardDriver() + + public virtual OpenTK.Input.IKeyboardDriver CreateKeyboardDriver() { throw new NotImplementedException(); }