Renamed Display to DisplayDevice.

This commit is contained in:
the_fiddler 2008-01-23 14:39:27 +00:00
parent de2cc325a4
commit 42acaf3165
2 changed files with 10 additions and 10 deletions

View file

@ -45,7 +45,7 @@ namespace OpenTK
/// <summary>Constructs a new DisplayMode with sensible default parameters.</summary> /// <summary>Constructs a new DisplayMode with sensible default parameters.</summary>
public DisplayMode() public DisplayMode()
: this(Display.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 2, false) : this(DisplayDevice.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 2, false)
{ {
} }
@ -141,7 +141,7 @@ namespace OpenTK
/// <param name="height">The Height of the DisplayMode in pixels.</param> /// <param name="height">The Height of the DisplayMode in pixels.</param>
[Obsolete] [Obsolete]
public DisplayMode(int width, int height) public DisplayMode(int width, int height)
: this(width, height, Display.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 0, false, false, false, 0.0f) : this(width, height, DisplayDevice.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 0, false, false, false, 0.0f)
{ {
} }

View file

@ -16,7 +16,7 @@ namespace OpenTK.Graphics
/// Defines a display device on the underlying system, and provides /// Defines a display device on the underlying system, and provides
/// methods to query and change its display parameters. /// methods to query and change its display parameters.
/// </summary> /// </summary>
public class Display public class DisplayDevice
{ {
// TODO: Add support for refresh rate queries and switches. // TODO: Add support for refresh rate queries and switches.
// TODO: Check whether bits_per_pixel works correctly under Mono/X11. // TODO: Check whether bits_per_pixel works correctly under Mono/X11.
@ -29,20 +29,20 @@ namespace OpenTK.Graphics
float refresh_rate; float refresh_rate;
bool primary; bool primary;
static List<Display> available_displays = new List<Display>(); static List<DisplayDevice> available_displays = new List<DisplayDevice>();
static object display_lock = new object(); static object display_lock = new object();
static Display primary_display; static DisplayDevice primary_display;
#region --- Constructors --- #region --- Constructors ---
static Display() static DisplayDevice()
{ {
lock (display_lock) lock (display_lock)
{ {
int i = 0; int i = 0;
foreach (System.Windows.Forms.Screen scr in System.Windows.Forms.Screen.AllScreens) foreach (System.Windows.Forms.Screen scr in System.Windows.Forms.Screen.AllScreens)
{ {
available_displays.Add(new Display(scr.Bounds.Width, scr.Bounds.Height, 32, 0, scr.Primary)); available_displays.Add(new DisplayDevice(scr.Bounds.Width, scr.Bounds.Height, 32, 0, scr.Primary));
if (scr.Primary) if (scr.Primary)
primary_display = available_displays[i]; primary_display = available_displays[i];
++i; ++i;
@ -50,7 +50,7 @@ namespace OpenTK.Graphics
} }
} }
Display(int width, int height, int bitsPerPixel, float refreshRate, bool primary) DisplayDevice(int width, int height, int bitsPerPixel, float refreshRate, bool primary)
{ {
this.width = width; this.width = width;
this.height = height; this.height = height;
@ -78,7 +78,7 @@ namespace OpenTK.Graphics
/// <summary> /// <summary>
/// Gets an array of OpenTK.Display objects, which describe all available display devices. /// Gets an array of OpenTK.Display objects, which describe all available display devices.
/// </summary> /// </summary>
public static Display[] AvailableDisplays public static DisplayDevice[] AvailableDisplays
{ {
get get
{ {
@ -90,7 +90,7 @@ namespace OpenTK.Graphics
} }
/// <summary>Gets the primary display of this system.</summary> /// <summary>Gets the primary display of this system.</summary>
public static Display PrimaryDisplay { get { return primary_display; } } public static DisplayDevice PrimaryDisplay { get { return primary_display; } }
#endregion #endregion