Permalink
Browse files

Use gdi32 implementations of functions

Several functions are defined in both gdi32 and opengl32. Using the
opengl32/wgl versions did not appear to help with issue #19. Let's use
the gdi32 version instead, as suggested here:
https://www.opengl.org/wiki/Platform_specifics:_Windows#The_WGL_functions
  • Loading branch information...
1 parent dd31b41 commit 44b8a9dbdcf2c44d1888b38c8bce9fe2e0821245 @thefiddler thefiddler committed Dec 17, 2013
@@ -376,13 +376,13 @@ static bool IsValid(IntPtr address)
}
PixelFormatDescriptor pfd = new PixelFormatDescriptor();
- Wgl.DescribePixelFormat(
+ Functions.DescribePixelFormat(
window.DeviceContext, (int)mode.Index.Value,
API.PixelFormatDescriptorSize, ref pfd);
Debug.WriteLine(mode.Index.ToString());
-
- if (!Wgl.SetPixelFormat(window.DeviceContext, (int)mode.Index.Value, ref pfd))
+
+ if (!Functions.SetPixelFormat(window.DeviceContext, (int)mode.Index.Value, ref pfd))
{
throw new GraphicsContextException(String.Format(
"Requested GraphicsMode not available. SetPixelFormat error: {0}",
@@ -131,7 +131,7 @@ IEnumerable<GraphicsMode> GetModesPFD(IntPtr device)
// 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 (Wgl.DescribePixelFormat(device, ++pixel, API.PixelFormatDescriptorSize, ref pfd) != 0)
+ while (Functions.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 44b8a9d

Please sign in to comment.