diff options
author | Sven Gothel <[email protected]> | 2012-09-21 08:28:42 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-09-21 08:28:42 +0200 |
commit | 459af1bba130495943e51ff289a094b602c642cd (patch) | |
tree | a0c4d606dd702f3d6ded054d7c4a52ae2f109797 | |
parent | 5b378cb2cd162cb9af44812c37935eb3a83aabd2 (diff) |
MacOSXCGLContext: Fix missing initialization of 'needsSetContextPBuffer' if not offscreen-layer.
-rwxr-xr-x | make/scripts/tests.sh | 4 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 8 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java | 4 |
3 files changed, 9 insertions, 7 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 9f09ffa6b..b8960d518 100755 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -250,7 +250,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLContextDrawableSwitchNEWT $* -testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateOnOffscrnCapsNEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateOnOffscrnCapsNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT $* @@ -426,7 +426,7 @@ testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateOnOf # # Security # -#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT $* +testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMapBufferRead01NEWT $* # diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 929ac00c2..eae365925 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -488,6 +488,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl throw new RuntimeException("Anonymous drawable instance's handle neither NSView, NSWindow nor PBuffer: "+toHexString(drawableHandle)+", "+drawable.getClass().getName()+",\n\t"+drawable); } } + needsSetContextPBuffer = isPBuffer; backingLayerHost = NativeWindowFactory.getOffscreenLayerSurface(surface, true); boolean incompleteView = null != backingLayerHost; @@ -600,11 +601,12 @@ public abstract class MacOSXCGLContext extends GLContextImpl public void swapBuffers(boolean doubleBuffered) { MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers(); } } ) ; - } else if( chosenCaps.isPBuffer() && CGL.isNSOpenGLPixelBuffer(drawableHandle) ) { + } else if( CGL.isNSOpenGLPixelBuffer(drawableHandle) ) { texID = 0; pbufferHandle = drawableHandle; if(0 != drawableHandle) { // complete 'validatePBufferConfig(..)' procedure CGL.setContextPBuffer(ctx, pbufferHandle); + needsSetContextPBuffer = false; } } else { throw new GLException("BackingLayerHost w/ unknown handle (!FBO, !PBuffer): "+drawable); @@ -652,9 +654,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl if( needsSetContextPBuffer && 0 != drawableHandle && CGL.isNSOpenGLPixelBuffer(drawableHandle) ) { // Must associate the pbuffer with our newly-created context needsSetContextPBuffer = false; - if(0 != drawableHandle) { - CGL.setContextPBuffer(ctx, drawableHandle); - } + CGL.setContextPBuffer(ctx, drawableHandle); if(DEBUG) { System.err.println("NS.validateDrawableConfig bind pbuffer "+toHexString(drawableHandle)+" -> ctx "+toHexString(ctx)); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java index bebe3531e..60803433d 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java @@ -61,6 +61,8 @@ public class TestGPUMemSec01NEWT extends UITestCase { new GLCapabilities(glp), width, height, true); final GL gl = winctx.context.getGL(); + // System.err.println("Pre GL Error: 0x"+Integer.toHexString(gl.glGetError())); + // System.err.println(winctx.drawable); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); // misc GL setup @@ -249,7 +251,7 @@ public class TestGPUMemSec01NEWT extends UITestCase { NEWTGLContext.destroyWindow(winctx); } - + @Test public void testReadPixelsGL_99x100xRGBxUB() throws InterruptedException { GLProfile glp = GLProfile.getGL2ES2(); |