diff options
author | Sven Gothel <[email protected]> | 2014-10-02 00:59:51 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-10-02 00:59:51 +0200 |
commit | 1b5c2dbc9204a85eb63cea952b289f5012690f35 (patch) | |
tree | dc910094e94eabe539dd9b9665765ce6641d7bf6 /src/jogl/classes/jogamp/opengl/windows | |
parent | 5d3caefa4ded044b2965d7e046e9c9fa35d58810 (diff) |
Bug 1078: Fix commit 99f91f8b28d42cdf341533736e878056bcae4708 (GLRendererQuirks.NoPBufferWithAccum): Accum buffer allowed if !usePBuffer; Avoid NPE.
99f91f8b28d42cdf341533736e878056bcae4708
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/windows')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java | 4 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java | 43 |
2 files changed, 25 insertions, 22 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java index 597f51178..5d925fe03 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java @@ -142,8 +142,8 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { System.out.println(getThreadName()+": Pbuffer chosenCaps: " + chosenCaps); } - if(!WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(chosenCaps, - iattributes, sharedResource, -1, floatModeTmp)){ + if( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList( sharedResource, chosenCaps, + iattributes, -1, floatModeTmp) ) { throw new GLException("Pbuffer-related extensions not supported"); } diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java index ee868b1c0..24d44b5dd 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java @@ -327,9 +327,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio final long hdc, final IntBuffer iattributes, final int accelerationMode, final FloatBuffer fattributes) { - if ( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities, - iattributes, sharedResource, accelerationMode, null)) - { + if ( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList( sharedResource, capabilities, + iattributes, accelerationMode, null) ) { if (DEBUG) { System.err.println("wglChoosePixelFormatARB: GLCapabilities2AttribList failed: " + GDI.GetLastError()); Thread.dumpStack(); @@ -412,9 +411,9 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio return bucket; } - static boolean GLCapabilities2AttribList(final GLCapabilitiesImmutable caps, + static boolean GLCapabilities2AttribList(final WindowsWGLDrawableFactory.SharedResource sharedResource, + final GLCapabilitiesImmutable caps, final IntBuffer iattributes, - final WindowsWGLDrawableFactory.SharedResource sharedResource, final int accelerationValue, final int[] floatMode) throws GLException { if (!sharedResource.hasARBPixelFormat()) { @@ -477,23 +476,27 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio } iattributes.put(niattribs++, WGLExt.WGL_DEPTH_BITS_ARB); iattributes.put(niattribs++, caps.getDepthBits()); - if (!sharedResource.getRendererQuirks().exist(GLRendererQuirks.NoPBufferWithAccum) && (caps.getAccumRedBits() > 0 || + + if( caps.getAccumRedBits() > 0 || caps.getAccumGreenBits() > 0 || caps.getAccumBlueBits() > 0 || - caps.getAccumAlphaBits() > 0)) { - iattributes.put(niattribs++, WGLExt.WGL_ACCUM_BITS_ARB); - iattributes.put(niattribs++, ( caps.getAccumRedBits() + - caps.getAccumGreenBits() + - caps.getAccumBlueBits() + - caps.getAccumAlphaBits() ) ); - iattributes.put(niattribs++, WGLExt.WGL_ACCUM_RED_BITS_ARB); - iattributes.put(niattribs++, caps.getAccumRedBits()); - iattributes.put(niattribs++, WGLExt.WGL_ACCUM_GREEN_BITS_ARB); - iattributes.put(niattribs++, caps.getAccumGreenBits()); - iattributes.put(niattribs++, WGLExt.WGL_ACCUM_BLUE_BITS_ARB); - iattributes.put(niattribs++, caps.getAccumBlueBits()); - iattributes.put(niattribs++, WGLExt.WGL_ACCUM_ALPHA_BITS_ARB); - iattributes.put(niattribs++, caps.getAccumAlphaBits()); + caps.getAccumAlphaBits() > 0 ) { + final GLRendererQuirks sharedQuirks = sharedResource.getRendererQuirks(); + if ( !usePBuffer || null==sharedQuirks || !sharedQuirks.exist(GLRendererQuirks.NoPBufferWithAccum) ) { + iattributes.put(niattribs++, WGLExt.WGL_ACCUM_BITS_ARB); + iattributes.put(niattribs++, ( caps.getAccumRedBits() + + caps.getAccumGreenBits() + + caps.getAccumBlueBits() + + caps.getAccumAlphaBits() ) ); + iattributes.put(niattribs++, WGLExt.WGL_ACCUM_RED_BITS_ARB); + iattributes.put(niattribs++, caps.getAccumRedBits()); + iattributes.put(niattribs++, WGLExt.WGL_ACCUM_GREEN_BITS_ARB); + iattributes.put(niattribs++, caps.getAccumGreenBits()); + iattributes.put(niattribs++, WGLExt.WGL_ACCUM_BLUE_BITS_ARB); + iattributes.put(niattribs++, caps.getAccumBlueBits()); + iattributes.put(niattribs++, WGLExt.WGL_ACCUM_ALPHA_BITS_ARB); + iattributes.put(niattribs++, caps.getAccumAlphaBits()); + } } if (caps.getSampleBuffers() && sharedResource.hasARBMultisample()) { |