Minor code cleanup
authorStefanos A. <stapostol@gmail.com>
Tue, 17 Dec 2013 15:40:15 +0000 (16:40 +0100)
committerStefanos A. <stapostol@gmail.com>
Tue, 17 Dec 2013 15:40:15 +0000 (16:40 +0100)
No need to wrap Wgl.DescribePixelFormat, just call it directly.

Source/OpenTK/Platform/Windows/WinGraphicsMode.cs

index 67f3ce19f933f7e2d16954cbdce2b2e27bdfd71c..f62f23154bbd0bd85f4be62e12afff664d636f04 100644 (file)
@@ -105,17 +105,6 @@ namespace OpenTK.Platform.Windows
 
         #region Private Methods
 
-        #region DescribePixelFormat
-
-        static int DescribePixelFormat(IntPtr hdc, int ipfd, int cjpfd, ref PixelFormatDescriptor pfd)
-        {
-            // Note: DescribePixelFormat found in gdi32 is extremely slow
-            // on nvidia, for some reason.
-            return Wgl.DescribePixelFormat(hdc, ipfd, (uint)cjpfd, out pfd);
-        }
-
-        #endregion
-
         #region GetModesPFD
 
         IEnumerable<GraphicsMode> GetModesPFD(IntPtr device)
@@ -140,8 +129,9 @@ namespace OpenTK.Platform.Windows
             {
                 // Iterate through all accelerated formats first. Afterwards, iterate through non-accelerated formats.
                 // This should fix issue #2224, which causes OpenTK to fail on VMs without hardware acceleration.
+                // Note: DescribePixelFormat found in gdi32 is extremely slow on nvidia, for some reason.
                 int pixel = 0;
-                while (DescribePixelFormat(device, ++pixel, API.PixelFormatDescriptorSize, ref pfd) != 0)
+                while (Wgl.DescribePixelFormat(device, ++pixel, API.PixelFormatDescriptorSize, ref pfd) != 0)
                 {
                     // Ignore non-accelerated formats.
                     if (!generic_allowed && (pfd.Flags & PixelFormatDescriptorFlags.GENERIC_FORMAT) != 0)