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:13:05 +00:00
|
|
|
|
lock (display_lock)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < API.ScreenCount; i++)
|
|
|
|
|
{
|
|
|
|
|
unsafe
|
|
|
|
|
{
|
|
|
|
|
XRRScreenSize[] array = Functions.XRRSizes(API.DefaultDisplay, i);
|
|
|
|
|
Debug.Print("{0} resolutions.", array.Length);
|
|
|
|
|
Debug.Indent();
|
|
|
|
|
int count = array.Length;
|
|
|
|
|
while (--count != 0)
|
|
|
|
|
Debug.Print(array[count].ToString());
|
|
|
|
|
Debug.Unindent();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//Functions.XRRSizes(API.DefaultDisplay, API.DefaultScreen,
|
|
|
|
|
//Functions.XRRGetScreenInfo(API.DefaultDisplay);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2008-01-25 10:21:00 +00:00
|
|
|
|
// Construct a default device for testing purposes.
|
|
|
|
|
new DisplayDevice(new DisplayResolution(800, 600, 24, 0), true,
|
|
|
|
|
new DisplayResolution[]
|
|
|
|
|
{
|
|
|
|
|
new DisplayResolution(800, 600, 24, 0)
|
|
|
|
|
});
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|