From 954b1e98b63239f2b188f200c31733beeb3e0fe6 Mon Sep 17 00:00:00 2001 From: Stefanos A Date: Tue, 17 Dec 2013 16:40:15 +0100 Subject: [PATCH] Minor code cleanup No need to wrap Wgl.DescribePixelFormat, just call it directly. --- Source/OpenTK/Platform/Windows/WinGraphicsMode.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs b/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs index 67f3ce19..f62f2315 100644 --- a/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs +++ b/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs @@ -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 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)