Moved ColorDepth and DisplayMode to the /OpenTK directory (where under /OpenTK/Platform).

Renamed ColorDepth to ColorMode, to avoid clash with System.Windows.Forms.ColorDepth
Updated examples to use the new namespace for DisplayMode and ColorMode.
This commit is contained in:
the_fiddler 2007-09-02 00:04:34 +00:00
parent 6af814b655
commit c2c3dac7df
3 changed files with 14 additions and 15 deletions

View file

@ -213,7 +213,7 @@ namespace Examples.Windowing
{
//glWindow2 = GLContext.Create(panel2, new OpenTK.OpenGL.ColorDepth(8, 8, 8, 8), 8, 0);
glWindow2 = new GLControl(
new DisplayMode(0, 0, new OpenTK.Platform.ColorDepth(32), 16, 0, 0, 2, false, false, false, 0.0f));
new DisplayMode(0, 0, new ColorMode(32), 16, 0, 0, 2, false, false, false, 0.0f));
create2.Enabled = false;
dispose2.Enabled = true;

View file

@ -8,15 +8,15 @@ using System;
using System.Drawing;
using System.Globalization;
namespace OpenTK.Platform
namespace OpenTK
{
public class ColorDepth
public class ColorMode
{
public byte Red, Green, Blue, Alpha;
public bool IsIndexed = false;
public int BitsPerPixel;
public ColorDepth(int bpp)
public ColorMode(int bpp)
{
Red = Green = Blue = Alpha = 0;
BitsPerPixel = bpp;
@ -47,7 +47,7 @@ namespace OpenTK.Platform
}
}
public ColorDepth(int red, int green, int blue, int alpha)
public ColorMode(int red, int green, int blue, int alpha)
{
Red = (byte)red;
Green = (byte)green;
@ -58,10 +58,10 @@ namespace OpenTK.Platform
public override bool Equals(object obj)
{
return (obj is ColorDepth) ? (this == (ColorDepth)obj) : false;
return (obj is ColorMode) ? (this == (ColorMode)obj) : false;
}
public static bool operator ==(ColorDepth left, ColorDepth right)
public static bool operator ==(ColorMode left, ColorMode right)
{
if ((object)left == (object)null && (object)right != (object)null ||
(object)left != (object)null && (object)right == (object)null)
@ -76,7 +76,7 @@ namespace OpenTK.Platform
left.Alpha == right.Alpha;
}
public static bool operator !=(ColorDepth left, ColorDepth right)
public static bool operator !=(ColorMode left, ColorMode right)
{
return !(left == right);
}

View file

@ -12,14 +12,14 @@ using System.Globalization;
#endregion
namespace OpenTK.Platform
namespace OpenTK
{
public sealed class DisplayMode
{
#region --- Private Variables ---
private int width, height;
private ColorDepth color;
private ColorMode color;
private int depthBits, stencilBits, auxBits;
@ -50,7 +50,7 @@ namespace OpenTK.Platform
public DisplayMode(
int width,
int height,
ColorDepth color,
ColorMode color,
int depth,
int stencil,
int aux,
@ -78,7 +78,7 @@ namespace OpenTK.Platform
/// Constructs a new DisplayMode with default values.
/// </summary>
public DisplayMode()
: this(0, 0, new ColorDepth(32), 16, 0, 0, 0, false, false, false, 0.0f)
: this(0, 0, new ColorMode(32), 16, 0, 0, 0, false, false, false, 0.0f)
{
}
@ -88,7 +88,7 @@ namespace OpenTK.Platform
/// <param name="width">The Width of the DisplayMode in pixels.</param>
/// <param name="height">The Height of the DisplayMode in pixels.</param>
public DisplayMode(int width, int height)
: this(width, height, new ColorDepth(32), 16, 0, 0, 0, false, false, false, 0.0f)
: this(width, height, new ColorMode(32), 16, 0, 0, 0, false, false, false, 0.0f)
{
}
@ -136,7 +136,7 @@ namespace OpenTK.Platform
#region public ColorDepth Color
public ColorDepth Color
public ColorMode Color
{
get { return this.color; }
set { this.color = value; }
@ -206,7 +206,6 @@ namespace OpenTK.Platform
RefreshRate
);
}
}
public class DisplayModeMatchOptions { }