diff --git a/Source/Examples/WinForms/W03_Extensions.cs b/Source/Examples/WinForms/W03_Extensions.cs index 0cea8553..10827e29 100644 --- a/Source/Examples/WinForms/W03_Extensions.cs +++ b/Source/Examples/WinForms/W03_Extensions.cs @@ -24,7 +24,7 @@ namespace Examples.WinForms [Example("Extensions", ExampleCategory.WinForms, 3)] public partial class W03_Extensions : Form { - GLControl glControl = new GLControl(GraphicsFormat.Default); + GLControl glControl = new GLControl(GraphicsMode.Default); Type glClass; Type delegatesClass; Type importsClass; diff --git a/Source/OpenTK/DisplayMode.cs b/Source/OpenTK/DisplayMode.cs index c1ea3348..02620778 100644 --- a/Source/OpenTK/DisplayMode.cs +++ b/Source/OpenTK/DisplayMode.cs @@ -307,9 +307,9 @@ namespace OpenTK #endregion - internal GraphicsFormat ToGraphicsFormat() + internal GraphicsMode ToGraphicsFormat() { - return new GraphicsFormat(this.Color.BitsPerPixel, this.DepthBits, this.StencilBits, 0, this.AuxBits, this.Buffers, this.Stereo); + return new GraphicsMode(this.Color.BitsPerPixel, this.DepthBits, this.StencilBits, 0, this.AuxBits, this.Buffers, this.Stereo); } #region --- Overrides --- diff --git a/Source/OpenTK/GLControl.cs b/Source/OpenTK/GLControl.cs index c84153f6..18383ef2 100644 --- a/Source/OpenTK/GLControl.cs +++ b/Source/OpenTK/GLControl.cs @@ -23,7 +23,7 @@ namespace OpenTK public partial class GLControl : UserControl { IGraphicsContext context; - GraphicsFormat format; + GraphicsMode format; IGLControlHelper helper; #region --- Constructor --- @@ -32,7 +32,7 @@ namespace OpenTK /// Constructs a new GLControl. /// public GLControl() - : this(GraphicsFormat.Default) + : this(GraphicsMode.Default) { } /// @@ -43,7 +43,7 @@ namespace OpenTK : this(mode.ToGraphicsFormat()) { } - public GLControl(GraphicsFormat format) + public GLControl(GraphicsMode format) { InitializeComponent(); @@ -119,7 +119,7 @@ namespace OpenTK if (context != null) throw new InvalidOperationException("GLControl already contains an OpenGL context."); if (format == null) - format = GraphicsFormat.Default; + format = GraphicsMode.Default; if (!this.DesignMode) { @@ -221,7 +221,7 @@ namespace OpenTK /// /// To change the GraphicsFormat, you must destroy and recreate the GLControl. /// - public GraphicsFormat GraphicsFormat + public GraphicsMode GraphicsFormat { get { return (Context as IGLContextInternal).GraphicsFormat; } } diff --git a/Source/OpenTK/GameWindow.cs b/Source/OpenTK/GameWindow.cs index 3143b939..4d318707 100644 --- a/Source/OpenTK/GameWindow.cs +++ b/Source/OpenTK/GameWindow.cs @@ -98,23 +98,23 @@ namespace OpenTK #region --- Contructors --- - public GameWindow() : this("OpenTK Game Window", 640, 480, null, GraphicsFormat.Default) { } + public GameWindow() : this("OpenTK Game Window", 640, 480, null, GraphicsMode.Default) { } - public GameWindow(string title) : this(title, 640, 480, null, GraphicsFormat.Default) { } + public GameWindow(string title) : this(title, 640, 480, null, GraphicsMode.Default) { } public GameWindow(string title, int width, int height) - : this(title, width, height, null, GraphicsFormat.Default) { } + : this(title, width, height, null, GraphicsMode.Default) { } - public GameWindow(string title, int width, int height, GraphicsFormat format) + public GameWindow(string title, int width, int height, GraphicsMode format) : this(title, width, height, null, format) { } public GameWindow(string title, DisplayResolution resolution) - : this(title, resolution.Width, resolution.Height, resolution, GraphicsFormat.Default) { } + : this(title, resolution.Width, resolution.Height, resolution, GraphicsMode.Default) { } - public GameWindow(string title, DisplayResolution resolution, GraphicsFormat format) + public GameWindow(string title, DisplayResolution resolution, GraphicsMode format) : this(title, resolution.Width, resolution.Height, resolution, format) { } - GameWindow(string title, int width, int height, DisplayResolution resolution, GraphicsFormat format) + GameWindow(string title, int width, int height, DisplayResolution resolution, GraphicsMode format) { if (Configuration.RunningOnWindows) glWindow = new OpenTK.Platform.Windows.WinGLNative(); diff --git a/Source/OpenTK/Graphics/GraphicsContext.cs b/Source/OpenTK/Graphics/GraphicsContext.cs index 921a9d3f..0747471c 100644 --- a/Source/OpenTK/Graphics/GraphicsContext.cs +++ b/Source/OpenTK/Graphics/GraphicsContext.cs @@ -39,7 +39,7 @@ namespace OpenTK.Graphics : this(mode.ToGraphicsFormat(), window) { } - public GraphicsContext(GraphicsFormat format, IWindowInfo window) + public GraphicsContext(GraphicsMode format, IWindowInfo window) { //if (available_contexts.Count == 0) // available_contexts.Add(IntPtr.Zero, new WeakReference(null)); @@ -247,7 +247,7 @@ namespace OpenTK.Graphics /// /// Gets the DisplayMode of the context. /// - GraphicsFormat IGLContextInternal.GraphicsFormat + GraphicsMode IGLContextInternal.GraphicsFormat { get { return (implementation as IGLContextInternal).GraphicsFormat; } } diff --git a/Source/OpenTK/Graphics/GraphicsFormat.cs b/Source/OpenTK/Graphics/GraphicsFormat.cs index cf1a0e5d..eab963ba 100644 --- a/Source/OpenTK/Graphics/GraphicsFormat.cs +++ b/Source/OpenTK/Graphics/GraphicsFormat.cs @@ -13,7 +13,7 @@ using System.Text; namespace OpenTK.Graphics { /// Defines the format for graphics operations. - public class GraphicsFormat + public class GraphicsMode { ColorDepth color_format, accumulator_format; int depth, stencil, buffers, samples; @@ -26,7 +26,7 @@ namespace OpenTK.Graphics /// /// Constructs a new GraphicsFormat from the given GraphicsFormat. /// - internal GraphicsFormat(GraphicsFormat mode) + internal GraphicsMode(GraphicsMode mode) : this(mode.ColorFormat, mode.Depth, mode.Stencil, mode.Samples, mode.AccumulatorFormat, mode.Buffers, mode.Stereo) { } #endregion @@ -34,7 +34,7 @@ namespace OpenTK.Graphics #region public GraphicsFormat() /// Constructs a new GraphicsFormat with sensible default parameters. - public GraphicsFormat() + public GraphicsMode() : this(Default) { } @@ -44,7 +44,7 @@ namespace OpenTK.Graphics /// Constructs a new GraphicsFormat with the specified parameters. /// The ColorFormat of the color buffer. - public GraphicsFormat(ColorDepth color) + public GraphicsMode(ColorDepth color) : this(color, Default.Depth, Default.Stencil, Default.Samples, Default.AccumulatorFormat, Default.Buffers, Default.Stereo) { } @@ -55,7 +55,7 @@ namespace OpenTK.Graphics /// Constructs a new GraphicsFormat with the specified parameters. /// The ColorFormat of the color buffer. /// The number of bits in the depth buffer. - public GraphicsFormat(ColorDepth color, int depth) + public GraphicsMode(ColorDepth color, int depth) : this(color, depth, Default.Stencil, Default.Samples, Default.AccumulatorFormat, Default.Buffers, Default.Stereo) { } @@ -67,7 +67,7 @@ namespace OpenTK.Graphics /// The ColorFormat of the color buffer. /// The number of bits in the depth buffer. /// The number of bits in the stencil buffer. - public GraphicsFormat(ColorDepth color, int depth, int stencil) + public GraphicsMode(ColorDepth color, int depth, int stencil) : this(color, depth, stencil, Default.Samples, Default.AccumulatorFormat, Default.Buffers, Default.Stereo) { } @@ -80,7 +80,7 @@ namespace OpenTK.Graphics /// The number of bits in the depth buffer. /// The number of bits in the stencil buffer. /// The number of samples for FSAA. - public GraphicsFormat(ColorDepth color, int depth, int stencil, int samples) + public GraphicsMode(ColorDepth color, int depth, int stencil, int samples) : this(color, depth, stencil, samples, Default.AccumulatorFormat, Default.Buffers, Default.Stereo) { } @@ -94,7 +94,7 @@ namespace OpenTK.Graphics /// The number of bits in the stencil buffer. /// The number of samples for FSAA. /// The ColorFormat of the accumilliary buffer. - public GraphicsFormat(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum) + public GraphicsMode(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum) : this(color, depth, stencil, samples, accum, Default.Buffers, Default.Stereo) { } @@ -109,7 +109,7 @@ namespace OpenTK.Graphics /// The number of samples for FSAA. /// The ColorFormat of the accumilliary buffer. /// The number of render buffers. Typical values include one (single-), two (double-) or three (triple-buffering). - public GraphicsFormat(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum, int buffers) + public GraphicsMode(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum, int buffers) : this(color, depth, stencil, samples, accum, buffers, Default.Stereo) { } @@ -125,7 +125,7 @@ namespace OpenTK.Graphics /// The ColorFormat of the accumilliary buffer. /// Set to true for a GraphicsFormat with stereographic capabilities. /// The number of render buffers. Typical values include one (single-), two (double-) or three (triple-buffering). - public GraphicsFormat(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum, int buffers, bool stereo) + public GraphicsMode(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum, int buffers, bool stereo) { if (depth < 0) throw new ArgumentOutOfRangeException("depth", "Must be greater than, or equal to zero."); if (stencil < 0) throw new ArgumentOutOfRangeException("stencil", "Must be greater than, or equal to zero."); @@ -239,9 +239,9 @@ namespace OpenTK.Graphics #region public static GraphicsFormat Default /// Returns an OpenTK.GraphicsFormat compatible with the underlying platform. - public static GraphicsFormat Default + public static GraphicsMode Default { - get { return new GraphicsFormat(DisplayDevice.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 0, 2, false); } + get { return new GraphicsMode(DisplayDevice.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 0, 2, false); } } #endregion diff --git a/Source/OpenTK/Graphics/IGraphicsContext.cs b/Source/OpenTK/Graphics/IGraphicsContext.cs index c45976bf..81c513d6 100644 --- a/Source/OpenTK/Graphics/IGraphicsContext.cs +++ b/Source/OpenTK/Graphics/IGraphicsContext.cs @@ -79,7 +79,7 @@ namespace OpenTK.Graphics IWindowInfo Info { get; } /// Gets the GraphicsFormat of the context. - GraphicsFormat GraphicsFormat { get; } + GraphicsMode GraphicsFormat { get; } ///// ///// Gets a System.IntPtr containing the handle to the OpenGL context which is current in the diff --git a/Source/OpenTK/Platform/DummyGLContext.cs b/Source/OpenTK/Platform/DummyGLContext.cs index 2c78edbf..a0d3fe02 100644 --- a/Source/OpenTK/Platform/DummyGLContext.cs +++ b/Source/OpenTK/Platform/DummyGLContext.cs @@ -17,19 +17,19 @@ namespace OpenTK.Platform /// internal sealed class DummyGLContext : IGraphicsContext { - GraphicsFormat format; + GraphicsMode format; bool vsync; #region --- Constructors --- - public DummyGLContext(GraphicsFormat format) { this.format = format; } + public DummyGLContext(GraphicsMode format) { this.format = format; } #endregion #region --- IGraphicsContext Members --- public IntPtr Context { get { return IntPtr.Zero; } } - public GraphicsFormat GraphicsFormat { get { return format; } } + public GraphicsMode GraphicsFormat { get { return format; } } public void CreateContext() { } public void CreateContext(bool direct) { } diff --git a/Source/OpenTK/Platform/Windows/WinGLContext.cs b/Source/OpenTK/Platform/Windows/WinGLContext.cs index c198f142..3bc2d588 100644 --- a/Source/OpenTK/Platform/Windows/WinGLContext.cs +++ b/Source/OpenTK/Platform/Windows/WinGLContext.cs @@ -32,7 +32,7 @@ namespace OpenTK.Platform.Windows const string opengl32Name = "OPENGL32.DLL"; WinWindowInfo windowInfo = new WinWindowInfo(); - GraphicsFormat format; + GraphicsMode format; //DisplayMode mode = null; bool vsync_supported; @@ -58,7 +58,7 @@ namespace OpenTK.Platform.Windows } } - GraphicsFormat SelectFormat(GraphicsFormat format) + GraphicsMode SelectFormat(GraphicsMode format) { using (WinGLNative native = new WinGLNative(16, 16)) //using (WinGLContext context = new WinGLContext(format, native.WindowInfo, null)) @@ -68,7 +68,7 @@ namespace OpenTK.Platform.Windows } } - public WinGLContext(GraphicsFormat format, IWindowInfo window, IGraphicsContext sharedContext) + public WinGLContext(GraphicsMode format, IWindowInfo window, IGraphicsContext sharedContext) { //format = this.SelectFormat(format); @@ -222,7 +222,7 @@ namespace OpenTK.Platform.Windows #region GraphicsFormat IGLContextInternal.GraphicsFormat - GraphicsFormat IGLContextInternal.GraphicsFormat + GraphicsMode IGLContextInternal.GraphicsFormat { get { return format; } } @@ -271,7 +271,7 @@ namespace OpenTK.Platform.Windows #region GraphicsFormat SetGraphicsFormatPFD(GraphicsFormat format) - GraphicsFormat SetGraphicsFormatPFD(GraphicsFormat format) + GraphicsMode SetGraphicsFormatPFD(GraphicsMode format) { deviceContext = Functions.GetDC(this.windowInfo.Handle); Debug.WriteLine(String.Format("Device context: {0}", deviceContext)); @@ -317,7 +317,7 @@ namespace OpenTK.Platform.Windows pixelFormat.Size = API.PixelFormatDescriptorSize; pixelFormat.Version = API.PixelFormatDescriptorVersion; Functions.DescribePixelFormat(deviceContext, pixel, API.PixelFormatDescriptorSize, ref pfd); - GraphicsFormat fmt = new GraphicsFormat( + GraphicsMode fmt = new GraphicsMode( new ColorDepth(pfd.RedBits, pfd.GreenBits, pfd.BlueBits, pfd.AlphaBits), pfd.DepthBits, pfd.StencilBits, @@ -338,7 +338,7 @@ namespace OpenTK.Platform.Windows #region GraphicsFormat SetGraphicsFormatARB(GraphicsFormat format) - GraphicsFormat SetGraphicsFormatARB(GraphicsFormat format) + GraphicsMode SetGraphicsFormatARB(GraphicsMode format) { return null; } diff --git a/Source/OpenTK/Platform/X11/X11GLContext.cs b/Source/OpenTK/Platform/X11/X11GLContext.cs index f323ffc0..074d216f 100644 --- a/Source/OpenTK/Platform/X11/X11GLContext.cs +++ b/Source/OpenTK/Platform/X11/X11GLContext.cs @@ -24,7 +24,7 @@ namespace OpenTK.Platform.X11 IntPtr context; DisplayMode mode; X11WindowInfo windowInfo = new X11WindowInfo(); - GraphicsFormat format; + GraphicsMode format; IntPtr visual; bool vsync_supported; int vsync_interval; @@ -306,7 +306,7 @@ namespace OpenTK.Platform.X11 #region public DisplayMode Mode - GraphicsFormat IGLContextInternal.GraphicsFormat + GraphicsMode IGLContextInternal.GraphicsFormat { get { return format; } }