From d40e883325b81c5003e664611f72db4a6b8f6220 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Wed, 1 Jun 2005 01:36:12 +0000 Subject: 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 --- src/net/java/games/jogl/impl/windows/WindowsGLContext.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/net/java/games') 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) -- cgit v1.2.3