Permalink
Browse files

Minor code cleanup

No need to wrap Wgl.DescribePixelFormat, just call it directly.
  • Loading branch information...
1 parent 9129e62 commit f4f793a5d32b507d4a3324a7c0bebe13e017a04a @thefiddler thefiddler committed Dec 17, 2013
Showing with 2 additions and 12 deletions.
  1. +2 −12 Source/OpenTK/Platform/Windows/WinGraphicsMode.cs
@@ -105,17 +105,6 @@ public WinGraphicsMode(IntPtr device)
#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 @@ IEnumerable<GraphicsMode> GetModesPFD(IntPtr device)
{
// 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)

0 comments on commit f4f793a

Please sign in to comment.