From ad6306bc9c1b59fccd5057e8066eb5d5963b420e Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sat, 26 Jan 2008 10:33:42 +0000 Subject: [PATCH] Fixed a bug where wrong resolutions were saved in the DisplayResolution<->resolution_index mapping. --- Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs b/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs index 40fb4cea..4fe6a4dd 100644 --- a/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs +++ b/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs @@ -68,7 +68,10 @@ namespace OpenTK.Platform.X11 available_res.Add(new DisplayResolution(size.Width, size.Height, depth, (float)rate)); } // Keep the index of this resolution - we will need it for resolution changes later. - screenResolutionToIndex[screen].Add(available_res[resolution_count], resolution_count); + foreach (int depth in depths) + screenResolutionToIndex[screen].Add(new DisplayResolution(size.Width, size.Height, depth, 0), + resolution_count); + ++resolution_count; }