diff --git a/OpenTK/Graphics/GraphicsErrorException.cs b/OpenTK/Graphics/GraphicsErrorException.cs
deleted file mode 100644
index 5417cd972..000000000
--- a/OpenTK/Graphics/GraphicsErrorException.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace OpenTK.Graphics
-{
- ///
- /// Identifies a specific OpenGL or OpenGL|ES error. Such exceptions are only thrown
- /// when OpenGL or OpenGL|ES automatic error checking is enabled -
- /// property.
- /// Important: Do *not* catch this exception. Rather, fix the underlying issue that caused the error.
- ///
- public class GraphicsErrorException : GraphicsException
- {
- ///
- /// Constructs a new GraphicsErrorException instance with the specified error message.
- ///
- ///
- public GraphicsErrorException(string message) : base(message) { }
- }
-}
diff --git a/OpenTK/Graphics/GraphicsMode.cs b/OpenTK/Graphics/GraphicsMode.cs
index 00808e63c..1eb6e20da 100644
--- a/OpenTK/Graphics/GraphicsMode.cs
+++ b/OpenTK/Graphics/GraphicsMode.cs
@@ -17,8 +17,7 @@ namespace OpenTK.Graphics
public class GraphicsMode : IEquatable
{
ColorFormat color_format;
- int depth, stencil, buffers, samples;
- bool stereo;
+ int depth, stencil, buffers;
IntPtr? index = null; // The id of the pixel format or visual.
static GraphicsMode defaultMode;
@@ -39,116 +38,32 @@ namespace OpenTK.Graphics
#endregion
- #region internal GraphicsMode(GraphicsMode mode)
-
- internal GraphicsMode(GraphicsMode mode)
- : this(mode.ColorFormat, mode.Depth, mode.Stencil, mode.Samples, mode.Buffers, mode.Stereo) { }
-
- #endregion
-
#region internal GraphicsMode(IntPtr? index, ColorFormat color, int depth, int stencil, int samples, ColorFormat accum, int buffers, bool stereo)
- internal GraphicsMode(IntPtr? index, ColorFormat color, int depth, int stencil, int samples,
- int buffers, bool stereo)
+ internal GraphicsMode(IntPtr? index, ColorFormat color, int depth, int stencil, int buffers)
{
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.");
if (buffers <= 0) throw new ArgumentOutOfRangeException("buffers", "Must be greater than zero.");
- if (samples < 0) throw new ArgumentOutOfRangeException("samples", "Must be greater than, or equal to zero.");
this.Index = index;
this.ColorFormat = color;
this.Depth = depth;
this.Stencil = stencil;
- this.Samples = samples;
this.Buffers = buffers;
- this.Stereo = stereo;
}
#endregion
- #region public GraphicsMode()
-
- /// Constructs a new GraphicsMode with sensible default parameters.
- public GraphicsMode()
- : this(Default)
- { }
-
- #endregion
-
- #region public GraphicsMode(ColorFormat color)
-
- /// Constructs a new GraphicsMode with the specified parameters.
- /// The ColorFormat of the color buffer.
- public GraphicsMode(ColorFormat color)
- : this(color, Default.Depth, Default.Stencil, Default.Samples, Default.Buffers, Default.Stereo)
- { }
-
- #endregion
-
- #region public GraphicsMode(ColorFormat color, int depth)
-
- /// Constructs a new GraphicsMode with the specified parameters.
- /// The ColorFormat of the color buffer.
- /// The number of bits in the depth buffer.
- public GraphicsMode(ColorFormat color, int depth)
- : this(color, depth, Default.Stencil, Default.Samples, Default.Buffers, Default.Stereo)
- { }
-
- #endregion
-
- #region public GraphicsMode(ColorFormat color, int depth, int stencil)
-
- /// Constructs a new GraphicsMode with the specified parameters.
- /// The ColorFormat of the color buffer.
- /// The number of bits in the depth buffer.
- /// The number of bits in the stencil buffer.
- public GraphicsMode(ColorFormat color, int depth, int stencil)
- : this(color, depth, stencil, Default.Samples, Default.Buffers, Default.Stereo)
- { }
-
- #endregion
-
- #region public GraphicsMode(ColorFormat color, int depth, int stencil, int samples)
-
- /// Constructs a new GraphicsMode with the specified parameters.
- /// The ColorFormat of the color buffer.
- /// The number of bits in the depth buffer.
- /// The number of bits in the stencil buffer.
- /// The number of samples for FSAA.
- public GraphicsMode(ColorFormat color, int depth, int stencil, int samples)
- : this(color, depth, stencil, samples, Default.Buffers, Default.Stereo)
- { }
-
- #endregion
-
- #region public GraphicsMode(ColorFormat color, int depth, int stencil, int samples, ColorFormat accum, int buffers)
-
- /// Constructs a new GraphicsMode with the specified parameters.
- /// The ColorFormat of the color buffer.
- /// The number of bits in the depth buffer.
- /// The number of bits in the stencil buffer.
- /// 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 GraphicsMode(ColorFormat color, int depth, int stencil, int samples, int buffers)
- : this(color, depth, stencil, samples, buffers, Default.Stereo)
- { }
-
- #endregion
-
#region public GraphicsMode(ColorFormat color, int depth, int stencil, int samples, ColorFormat accum, int buffers, bool stereo)
/// Constructs a new GraphicsMode with the specified parameters.
/// The ColorFormat of the color buffer.
/// The number of bits in the depth buffer.
/// The number of bits in the stencil buffer.
- /// The number of samples for FSAA.
- /// The ColorFormat of the accumilliary buffer.
- /// Set to true for a GraphicsMode with stereographic capabilities.
/// The number of render buffers. Typical values include one (single-), two (double-) or three (triple-buffering).
- public GraphicsMode(ColorFormat color, int depth, int stencil, int samples, int buffers, bool stereo)
- : this(null, color, depth, stencil, samples, buffers, stereo) { }
+ public GraphicsMode(ColorFormat color, int depth, int stencil, int buffers)
+ : this(null, color, depth, stencil, buffers) { }
#endregion
@@ -226,40 +141,6 @@ namespace OpenTK.Graphics
#endregion
- #region public int Samples
-
- ///
- /// Gets a System.Int32 that contains the number of FSAA samples per pixel for this GraphicsFormat.
- ///
- public int Samples
- {
- get
- {
- LazySelectGraphicsMode();
- return samples;
- }
- private set { samples = value; }
- }
-
- #endregion
-
- #region public bool Stereo
-
- ///
- /// Gets a System.Boolean indicating whether this DisplayMode is stereoscopic.
- ///
- public bool Stereo
- {
- get
- {
- LazySelectGraphicsMode();
- return stereo;
- }
- private set { stereo = value; }
- }
-
- #endregion
-
#region public int Buffers
///
@@ -289,9 +170,9 @@ namespace OpenTK.Graphics
{
if (defaultMode == null)
{
- Debug.Print("Creating default GraphicsMode ({0}, {1}, {2}, {3}, {4}, {5}, {6}).", DisplayDevice.Default.BitsPerPixel,
- 16, 0, 0, 0, 2, false);
- defaultMode = new GraphicsMode(DisplayDevice.Default.BitsPerPixel, 16, 0, 0, 2, false);
+ Debug.Print("Creating default GraphicsMode ({0}, {1}, {2}, {3}).", DisplayDevice.Default.BitsPerPixel,
+ 16, 0, 2);
+ defaultMode = new GraphicsMode(DisplayDevice.Default.BitsPerPixel, 16, 0, 2);
}
return defaultMode;
}
@@ -311,15 +192,13 @@ namespace OpenTK.Graphics
{
if (index == null)
{
- GraphicsMode mode = implementation.SelectGraphicsMode(color_format, depth, stencil, samples, buffers, stereo);
+ GraphicsMode mode = implementation.SelectGraphicsMode(color_format, depth, stencil, buffers);
Index = mode.Index;
ColorFormat = mode.ColorFormat;
Depth = mode.Depth;
Stencil = mode.Stencil;
- Samples = mode.Samples;
Buffers = mode.Buffers;
- Stereo = mode.Stereo;
}
}
@@ -331,8 +210,8 @@ namespace OpenTK.Graphics
/// ! System.String describing the current GraphicsFormat.
public override string ToString()
{
- return String.Format("Index: {0}, Color: {1}, Depth: {2}, Stencil: {3}, Samples: {4}, Buffers: {5}, Stereo: {6}",
- Index, ColorFormat, Depth, Stencil, Samples, Buffers, Stereo);
+ return String.Format("Index: {0}, Color: {1}, Depth: {2}, Stencil: {3}, Buffers: {4}",
+ Index, ColorFormat, Depth, Stencil, Buffers);
}
///
diff --git a/OpenTK/Graphics/IGraphicsMode.cs b/OpenTK/Graphics/IGraphicsMode.cs
index 2274b2594..fc834b5c5 100644
--- a/OpenTK/Graphics/IGraphicsMode.cs
+++ b/OpenTK/Graphics/IGraphicsMode.cs
@@ -14,9 +14,8 @@ namespace OpenTK.Graphics
{
// Creates a temporary OpenGL context (if necessary) and finds the mode which closest matches
// the specified parameters.
- public virtual GraphicsMode SelectGraphicsMode(ColorFormat color, int depth, int stencil, int samples, int buffers,
- bool stereo) {
- return new GraphicsMode((IntPtr)1, color, depth, stencil, samples, buffers, stereo);
+ public virtual GraphicsMode SelectGraphicsMode(ColorFormat color, int depth, int stencil, int buffers) {
+ return new GraphicsMode((IntPtr)1, color, depth, stencil, buffers);
}
}
}
diff --git a/OpenTK/OpenTK.csproj b/OpenTK/OpenTK.csproj
index 1b27cc3ff..1bb14c000 100644
--- a/OpenTK/OpenTK.csproj
+++ b/OpenTK/OpenTK.csproj
@@ -69,7 +69,6 @@
-
diff --git a/OpenTK/Platform/MacOS/AglContext.cs b/OpenTK/Platform/MacOS/AglContext.cs
index 38089c564..41009871e 100644
--- a/OpenTK/Platform/MacOS/AglContext.cs
+++ b/OpenTK/Platform/MacOS/AglContext.cs
@@ -77,12 +77,6 @@ namespace OpenTK.Platform.MacOS
if (mode.Stencil > 0)
AddPixelAttrib(aglAttributes, Agl.PixelFormatAttribute.AGL_STENCIL_SIZE, mode.Stencil);
-
- if (mode.Samples > 1)
- {
- AddPixelAttrib(aglAttributes, Agl.PixelFormatAttribute.AGL_SAMPLE_BUFFERS_ARB, 1);
- AddPixelAttrib(aglAttributes, Agl.PixelFormatAttribute.AGL_SAMPLES_ARB, mode.Samples);
- }
if (fullscreen)
{
diff --git a/OpenTK/Platform/Windows/WinGLContext.cs b/OpenTK/Platform/Windows/WinGLContext.cs
index 3770afbc8..d9163fcbd 100644
--- a/OpenTK/Platform/Windows/WinGLContext.cs
+++ b/OpenTK/Platform/Windows/WinGLContext.cs
@@ -200,9 +200,8 @@ namespace OpenTK.Platform.Windows
Mode = new GraphicsMode(
(IntPtr)modeIndex, new ColorFormat(pfd.RedBits, pfd.GreenBits, pfd.BlueBits, pfd.AlphaBits),
- pfd.DepthBits, pfd.StencilBits, 0,
- (pfd.Flags & PixelFormatDescriptorFlags.DOUBLEBUFFER) != 0 ? 2 : 1,
- (pfd.Flags & PixelFormatDescriptorFlags.STEREO) != 0);
+ pfd.DepthBits, pfd.StencilBits,
+ (pfd.Flags & PixelFormatDescriptorFlags.DOUBLEBUFFER) != 0 ? 2 : 1);
Debug.WriteLine(modeIndex);
if (!Functions.SetPixelFormat(window.DeviceContext, modeIndex, ref pfd))
diff --git a/OpenTK/Platform/X11/X11GraphicsMode.cs b/OpenTK/Platform/X11/X11GraphicsMode.cs
index 9af84f79c..e3d0c7f62 100644
--- a/OpenTK/Platform/X11/X11GraphicsMode.cs
+++ b/OpenTK/Platform/X11/X11GraphicsMode.cs
@@ -32,8 +32,7 @@ namespace OpenTK.Platform.X11
#region IGraphicsMode Members
- public override GraphicsMode SelectGraphicsMode(ColorFormat color, int depth, int stencil, int samples,
- int buffers, bool stereo)
+ public override GraphicsMode SelectGraphicsMode(ColorFormat color, int depth, int stencil, int buffers)
{
GraphicsMode gfx;
// The actual GraphicsMode that will be selected.
@@ -65,8 +64,7 @@ namespace OpenTK.Platform.X11
++buffers;
// the above lines returns 0 - false and 1 - true.
- gfx = new GraphicsMode(info.VisualID, new ColorFormat(r, g, b, a), depth, stencil, samples,
- buffers, stereo);
+ gfx = new GraphicsMode(info.VisualID, new ColorFormat(r, g, b, a), depth, stencil, buffers);
using (new XLock(display))
{