diff options
author | Kenneth Russel <[email protected]> | 2004-04-26 16:26:46 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2004-04-26 16:26:46 +0000 |
commit | 89428de3de8c83eb4ece9a05a1ef5b2ef9cf7cd7 (patch) | |
tree | 6cb9291e1f91a9e2d2ec2a0a1e86bdc5ac990958 | |
parent | ad0eb54fa214b537ac52ea15c6563ba5a3720d1a (diff) |
Fixed problem identified by William Denniss on JOGL forums where
PIXELFORMATDESCRIPTOR didn't have its size or version fields
initialized
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@126 232f8b59-042b-4e1e-8c03-345bb8c30851
-rw-r--r-- | src/net/java/games/jogl/impl/windows/WindowsGLContext.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java index 45bd7f21d..56a7188eb 100644 --- a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java +++ b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java @@ -257,13 +257,12 @@ public abstract class WindowsGLContext extends GLContext { if (onscreen) { GLCapabilities[] availableCaps = null; int numFormats = 0; - pfd = new PIXELFORMATDESCRIPTOR(); + pfd = newPixelFormatDescriptor(); GraphicsDevice device = component.getGraphicsConfiguration().getDevice(); // Produce a recommended pixel format selection for the GLCapabilitiesChooser. // Try to use wglChoosePixelFormatARB if we have it available GL dummyGL = WindowsGLContextFactory.getDummyGLContext(device); int recommendedPixelFormat = -1; - pfd = new PIXELFORMATDESCRIPTOR(); boolean haveWGLChoosePixelFormatARB = false; boolean haveWGLARBMultisample = false; if (dummyGL != null) { @@ -472,9 +471,7 @@ public abstract class WindowsGLContext extends GLContext { if (colorDepth < 15) { throw new GLException("Bit depths < 15 (i.e., non-true-color) not supported"); } - PIXELFORMATDESCRIPTOR pfd = new PIXELFORMATDESCRIPTOR(); - pfd.nSize((short) pfd.size()); - pfd.nVersion((short) 1); + PIXELFORMATDESCRIPTOR pfd = newPixelFormatDescriptor(); int pfdFlags = (WGL.PFD_SUPPORT_OPENGL | WGL.PFD_GENERIC_ACCELERATED); if (caps.getDoubleBuffered()) { @@ -499,6 +496,13 @@ public abstract class WindowsGLContext extends GLContext { return pfd; } + static PIXELFORMATDESCRIPTOR newPixelFormatDescriptor() { + PIXELFORMATDESCRIPTOR pfd = new PIXELFORMATDESCRIPTOR(); + pfd.nSize((short) pfd.size()); + pfd.nVersion((short) 1); + return pfd; + } + static GLCapabilities pfd2GLCapabilities(PIXELFORMATDESCRIPTOR pfd) { if ((pfd.dwFlags() & WGL.PFD_SUPPORT_OPENGL) == 0) { return null; |