summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2004-07-15 22:28:18 +0000
committerKenneth Russel <[email protected]>2004-07-15 22:28:18 +0000
commit556d51486c1692f124304a4b391c7fc05df576af (patch)
tree44c54a8586c14ac573861436b93229b0c7fc8d13 /src
parent554aeda4c46ee889e7ccb2cf1f988328b856bad1 (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
Diffstat (limited to 'src')
-rw-r--r--src/net/java/games/jogl/impl/windows/WindowsGLContext.java6
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) {