diff options
author | Kenneth Russel <[email protected]> | 2005-06-01 01:36:12 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-06-01 01:36:12 +0000 |
commit | d40e883325b81c5003e664611f72db4a6b8f6220 (patch) | |
tree | 52efe7bb64d0f0a54810811b874e7349ee093ad9 /src/net/java/games | |
parent | 3ef190e389531bedae61b6b73cf1ed1bba13acd8 (diff) |
Changed Windows pixel format selection algorithm to prefer
ChoosePixelFormat / DescribePixelFormat, rather than
wglChoosePixelFormatARB / wglGetPixelFormatAttribivARB, when
multisampling is not requested. This is more in line with how LWJGL
works and reduces the severity of a memory leak in ATI's current
Windows drivers.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@291 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games')
-rw-r--r-- | src/net/java/games/jogl/impl/windows/WindowsGLContext.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java index 367015ce3..cbdf359dc 100644 --- a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java +++ b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java @@ -284,8 +284,11 @@ public abstract class WindowsGLContext extends GLContext { GraphicsConfiguration config = component.getGraphicsConfiguration(); GraphicsDevice device = config.getDevice(); // Produce a recommended pixel format selection for the GLCapabilitiesChooser. - // Try to use wglChoosePixelFormatARB if we have it available - GL dummyGL = WindowsGLContextFactory.getDummyGL(device); + // Use wglChoosePixelFormatARB if user requested multisampling and if we have it available + GL dummyGL = null; + if (capabilities.getSampleBuffers()) { + dummyGL = WindowsGLContextFactory.getDummyGL(device); + } int recommendedPixelFormat = -1; boolean haveWGLChoosePixelFormatARB = false; boolean haveWGLARBMultisample = false; @@ -468,7 +471,11 @@ public abstract class WindowsGLContext extends GLContext { if (!gotAvailableCaps) { if (DEBUG) { - System.err.println("Using ChoosePixelFormat because no wglChoosePixelFormatARB: dummyGL = " + dummyGL); + if (!capabilities.getSampleBuffers()) { + System.err.println("Using ChoosePixelFormat because multisampling not requested"); + } else { + System.err.println("Using ChoosePixelFormat because no wglChoosePixelFormatARB: dummyGL = " + dummyGL); + } } pfd = glCapabilities2PFD(capabilities, onscreen); // Remove one-basing of pixel format (added on later) |