Screen and resolution enumeration should now work.

This commit is contained in:
the_fiddler 2008-01-25 13:56:52 +00:00
parent 5232e0a3b2
commit a1da9ff305

View file

@ -27,29 +27,24 @@ namespace OpenTK.Platform.X11
{ {
for (int i = 0; i < API.ScreenCount; i++) for (int i = 0; i < API.ScreenCount; i++)
{ {
List<DisplayResolution> resolutions = new List<DisplayResolution>();
unsafe unsafe
{ {
Debug.Print("Checkpoint 1");
XRRScreenSize[] array = Functions.XRRSizes(API.DefaultDisplay, i); XRRScreenSize[] array = Functions.XRRSizes(API.DefaultDisplay, i);
Debug.Print("{0} resolutions.", array.Length); Debug.Print("{0} resolutions.", array.Length);
Debug.Indent(); Debug.Indent();
int count = array.Length; for (int count = 0; count < array.Length; count++)
while (count-- != 0) {
Debug.Print(array[count].ToString()); resolutions.Add(new DisplayResolution(array[i].Width, array[i].Height, 0, 0));
Debug.Print(resolutions[count].ToString());
}
Debug.Unindent(); Debug.Unindent();
} }
}
//Functions.XRRSizes(API.DefaultDisplay, API.DefaultScreen,
//Functions.XRRGetScreenInfo(API.DefaultDisplay);
}
// Construct a default device for testing purposes. // Construct a default device for testing purposes.
new DisplayDevice(new DisplayResolution(800, 600, 24, 0), true, new DisplayDevice(resolutions[0], i == API.DefaultScreen, resolutions);
new DisplayResolution[] }
{ }
new DisplayResolution(800, 600, 24, 0)
});
} }
public X11XrandrDisplayDevice() public X11XrandrDisplayDevice()