diff options
author | Kenneth Russel <[email protected]> | 2004-07-15 22:28:18 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2004-07-15 22:28:18 +0000 |
commit | 556d51486c1692f124304a4b391c7fc05df576af (patch) | |
tree | 44c54a8586c14ac573861436b93229b0c7fc8d13 | |
parent | 554aeda4c46ee889e7ccb2cf1f988328b856bad1 (diff) |
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
-rw-r--r-- | src/net/java/games/jogl/impl/windows/WindowsGLContext.java | 6 |
1 files changed, 4 insertions, 2 deletions
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) { |