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
This commit is contained in:
Stefanos A. 2013-12-17 22:35:30 +01:00
parent dd31b41f08
commit 44b8a9dbdc
2 changed files with 4 additions and 4 deletions

View file

@ -376,13 +376,13 @@ namespace OpenTK.Platform.Windows
}
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}",

View file

@ -131,7 +131,7 @@ namespace OpenTK.Platform.Windows
// 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)