From 556d51486c1692f124304a4b391c7fc05df576af Mon Sep 17 00:00:00 2001 From: Kenneth Russel <kbrussel@alum.mit.edu> Date: Thu, 15 Jul 2004 22:28:18 +0000 Subject: Fixed Issue 96: Off-by-one error in pixel format selection on Windows git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@138 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/net/java/games/jogl/impl/windows/WindowsGLContext.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/net/java/games/jogl/impl/windows/WindowsGLContext.java') diff --git a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java index d58a781a8..0dd05f7ba 100644 --- a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java +++ b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java @@ -359,7 +359,8 @@ public abstract class WindowsGLContext extends GLContext { numFormatsTmp)) { numFormats = numFormatsTmp[0]; if (numFormats > 0) { - recommendedPixelFormat = pformats[0]; + // Remove one-basing of pixel format (added on later) + recommendedPixelFormat = pformats[0] - 1; if (DEBUG) { System.err.println("Used wglChoosePixelFormatARB to recommend pixel format " + recommendedPixelFormat); } @@ -427,7 +428,8 @@ public abstract class WindowsGLContext extends GLContext { System.err.println("Using ChoosePixelFormat because no wglChoosePixelFormatARB: dummyGL = " + dummyGL); } pfd = glCapabilities2PFD(capabilities, onscreen); - recommendedPixelFormat = WGL.ChoosePixelFormat(hdc, pfd); + // Remove one-basing of pixel format (added on later) + recommendedPixelFormat = WGL.ChoosePixelFormat(hdc, pfd) - 1; numFormats = WGL.DescribePixelFormat(hdc, 1, 0, null); if (numFormats == 0) { -- cgit v1.2.3