2008-01-25 10:02:05 +00:00
|
|
|
|
#region --- License ---
|
|
|
|
|
/* Licensed under the MIT/X11 license.
|
|
|
|
|
* Copyright (c) 2006-2008 the OpenTK team.
|
|
|
|
|
* This notice may not be removed.
|
|
|
|
|
* See license.txt for licensing detailed licensing details.
|
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
using OpenTK.Graphics;
|
2008-01-25 13:13:05 +00:00
|
|
|
|
using System.Diagnostics;
|
2008-01-25 10:02:05 +00:00
|
|
|
|
|
|
|
|
|
namespace OpenTK.Platform.X11
|
|
|
|
|
{
|
|
|
|
|
internal class X11XrandrDisplayDevice : IDisplayDeviceDriver
|
|
|
|
|
{
|
2008-01-25 13:13:05 +00:00
|
|
|
|
static object display_lock = new object();
|
|
|
|
|
|
2008-01-25 10:02:05 +00:00
|
|
|
|
#region --- Constructors ---
|
|
|
|
|
|
|
|
|
|
static X11XrandrDisplayDevice()
|
|
|
|
|
{
|
2008-01-25 13:45:32 +00:00
|
|
|
|
//lock (display_lock)
|
2008-01-25 13:13:05 +00:00
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < API.ScreenCount; i++)
|
|
|
|
|
{
|
2008-01-25 13:56:52 +00:00
|
|
|
|
List<DisplayResolution> resolutions = new List<DisplayResolution>();
|
2008-01-25 13:13:05 +00:00
|
|
|
|
unsafe
|
|
|
|
|
{
|
|
|
|
|
XRRScreenSize[] array = Functions.XRRSizes(API.DefaultDisplay, i);
|
|
|
|
|
Debug.Print("{0} resolutions.", array.Length);
|
|
|
|
|
Debug.Indent();
|
2008-01-25 13:56:52 +00:00
|
|
|
|
for (int count = 0; count < array.Length; count++)
|
|
|
|
|
{
|
2008-01-25 14:01:07 +00:00
|
|
|
|
resolutions.Add(new DisplayResolution(array[count].Width, array[count].Height, 24, 0));
|
2008-01-25 13:56:52 +00:00
|
|
|
|
Debug.Print(resolutions[count].ToString());
|
|
|
|
|
}
|
2008-01-25 13:13:05 +00:00
|
|
|
|
Debug.Unindent();
|
|
|
|
|
}
|
2008-01-25 13:56:52 +00:00
|
|
|
|
|
|
|
|
|
// Construct a default device for testing purposes.
|
|
|
|
|
new DisplayDevice(resolutions[0], i == API.DefaultScreen, resolutions);
|
2008-01-25 13:13:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2008-01-25 10:02:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public X11XrandrDisplayDevice()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region --- IDisplayDeviceDriver Members ---
|
|
|
|
|
|
|
|
|
|
public bool TryChangeResolution(DisplayDevice device, DisplayResolution resolution)
|
|
|
|
|
{
|
2008-01-25 10:03:13 +00:00
|
|
|
|
return false;
|
2008-01-25 10:02:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RestoreResolution(DisplayDevice device)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|