From e96882ae569c681e1b28da6701bf547f6dd9eda8 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 28 Jul 2014 15:29:59 +0200 Subject: Bug 1037 - FBObject/GLFBODrawable: Do not assume using a TextureAttachment for a Colorbuffer, also make DEPTH optional. API Change +++ In certain cases a TextureAttachment for the FBO's color buffer is not desired, either for performance reasons where texture functionality is not required or to avoid texture restrictions like size, etc. +++ GLFBODrawable shall use TextureAttachment for the FBO's color buffer and a DEPTH buffer per default. However, the user shall be allowed to use a plain ColorAttachment (renderbuffer) and also no DEPTH buffer. +++ FBObject Details: - Colorbuffer interface exposes Attachment details like format, size, etc as well as it's implementation specifics, isTextureAttachment() and getTextureAttachment() allowing a clean cast and type query. - Allow ColorAttachment to be used for non MSAA - Make TextureAttachment optional for method 'use(GL, TextureAttachment)' - Only validate size against MAX_TEXTURESIZE if using a TextureAttachment - API Change: - rename: getColorAttachmentCount() -> getColorbufferCount() - add: getTextureAttachmentCount() - change 'TextureAttachment getSamplingSink()' -> 'Colorbuffer getSamplingSink()' --- .../graph/demos/ui/GLEventListenerButton.java | 2 +- .../jogl/acore/TestFBOAutoDrawableFactoryNEWT.java | 159 ++++++++++++++------- ...tFBOOffThreadSharedContextMix2DemosES2NEWT.java | 8 +- .../TestFBOOnThreadSharedContext1DemoES2NEWT.java | 4 +- .../test/junit/jogl/demos/es2/FBOMix2DemosES2.java | 12 +- .../demos/es2/TextureDraw02ES2ListenerFBO.java | 6 +- 6 files changed, 122 insertions(+), 69 deletions(-) (limited to 'src/test/com') diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java index bdbb77f2d..06d869282 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java @@ -108,7 +108,7 @@ public class GLEventListenerButton extends TextureSeqButton { fboGLAD.addGLEventListener(glel); fboGLAD.display(); // 1st init! - final FBObject.TextureAttachment texA01 = fboGLAD.getTextureBuffer(GL.GL_FRONT); + final FBObject.TextureAttachment texA01 = fboGLAD.getColorbuffer(GL.GL_FRONT).getTextureAttachment(); final Texture tex = new Texture(texA01.getName(), imgSeq.getTextureTarget(), fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(), fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(), false /* mustFlipVertically */); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java index a0a5e8969..6bbe00fcb 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java @@ -34,6 +34,7 @@ import javax.media.opengl.GLCapabilitiesImmutable; import javax.media.opengl.GLContext; import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.GLEventListener; +import javax.media.opengl.GLFBODrawable; import javax.media.opengl.GLOffscreenAutoDrawable; import javax.media.opengl.GLProfile; @@ -71,77 +72,107 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { } @Test - public void test01_GL2ES2_Demo1_SingleBuffer_Normal() throws InterruptedException { + public void test01a_GL2ES2_Demo1_SingleBuffer_Normal() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities(glp); caps.setDoubleBuffered(false); - testGLFBODrawableImpl(caps, new GearsES2(0)); + testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0)); + } + @Test + public void test01b_GL2ES2_Demo1_SingleBuffer_NoTex() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities(glp); + caps.setDoubleBuffered(false); + testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_DEPTH, new GearsES2(0)); + } + @Test + public void test01c_GL2ES2_Demo1_SingleBuffer_NoTexNoDepth() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities(glp); + caps.setDoubleBuffered(false); + testGLFBODrawableImpl(caps, 0, new GearsES2(0)); } @Test - public void test02_GL2ES2_Demo1_DoubleBuffer_Normal() throws InterruptedException { + public void test02a_GL2ES2_Demo1_DoubleBuffer_Normal() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities(glp); caps.setDoubleBuffered(true); // default - testGLFBODrawableImpl(caps, new GearsES2(0)); + testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0)); } @Test - public void test03_GL2ES2_Demo2MSAA4() throws InterruptedException { + public void test03a_GL2ES2_Demo2MSAA4_Normal() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities(glp); caps.setSampleBuffers(true); caps.setNumSamples(4); - testGLFBODrawableImpl(caps, new MultisampleDemoES2(true)); + testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new MultisampleDemoES2(true)); + } + @Test + public void test03b_GL2ES2_Demo2MSAA4_NoTex() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities(glp); + caps.setSampleBuffers(true); + caps.setNumSamples(4); + testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_DEPTH, new MultisampleDemoES2(true)); + } + @Test + public void test03c_GL2ES2_Demo2MSAA4_NoTexNoDepth() throws InterruptedException { + final GLProfile glp = GLProfile.getGL2ES2(); + final GLCapabilities caps = new GLCapabilities(glp); + caps.setSampleBuffers(true); + caps.setNumSamples(4); + testGLFBODrawableImpl(caps, 0, new MultisampleDemoES2(true)); } @Test - public void test04_GL2ES2_FBODemoMSAA4() throws InterruptedException { + public void test04_GL2ES2_FBODemoMSAA4_Normal() throws InterruptedException { final GLProfile glp = GLProfile.getGL2ES2(); final FBOMix2DemosES2 demo = new FBOMix2DemosES2(0); demo.setDoRotation(false); final GLCapabilities caps = new GLCapabilities(glp); caps.setSampleBuffers(true); caps.setNumSamples(4); - testGLFBODrawableImpl(caps, demo); + testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, demo); } @Test - public void test05_EGLES2_Demo0Normal() throws InterruptedException { + public void test11_EGLES2_Demo0Normal() throws InterruptedException { if( GLProfile.isAvailable(GLProfile.GLES2) ) { final GLProfile glp = GLProfile.get(GLProfile.GLES2); final GLCapabilities caps = new GLCapabilities(glp); - testGLFBODrawableImpl(caps, new GearsES2(0)); + testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0)); } else { System.err.println("EGL ES2 n/a"); } } @Test - public void test06_GL3_Demo0Normal() throws InterruptedException { - if( GLProfile.isAvailable(GLProfile.GL3) ) { - final GLProfile glp = GLProfile.get(GLProfile.GL3); + public void test13_EGLES2_Demo0MSAA4() throws InterruptedException { + if( GLProfile.isAvailable(GLProfile.GLES2) ) { + final GLProfile glp = GLProfile.get(GLProfile.GLES2); final GLCapabilities caps = new GLCapabilities(glp); - testGLFBODrawableImpl(caps, new GearsES2(0)); + caps.setSampleBuffers(true); + caps.setNumSamples(4); + testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0)); } else { - System.err.println("GL3 n/a"); + System.err.println("EGL ES2 n/a"); } } @Test - public void test07_EGLES2_Demo0MSAA4() throws InterruptedException { - if( GLProfile.isAvailable(GLProfile.GLES2) ) { - final GLProfile glp = GLProfile.get(GLProfile.GLES2); + public void test21_GL3_Demo0Normal() throws InterruptedException { + if( GLProfile.isAvailable(GLProfile.GL3) ) { + final GLProfile glp = GLProfile.get(GLProfile.GL3); final GLCapabilities caps = new GLCapabilities(glp); - caps.setSampleBuffers(true); - caps.setNumSamples(4); - testGLFBODrawableImpl(caps, new GearsES2(0)); + testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0)); } else { - System.err.println("EGL ES2 n/a"); + System.err.println("GL3 n/a"); } } - void testGLFBODrawableImpl(final GLCapabilities caps, final GLEventListener demo) throws InterruptedException { + void testGLFBODrawableImpl(final GLCapabilities caps, final int fboMode, final GLEventListener demo) throws InterruptedException { caps.setFBO(true); final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile()); final GLOffscreenAutoDrawable.FBO glad = (GLOffscreenAutoDrawable.FBO) @@ -151,6 +182,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { System.out.println("Realized GLAD: "+glad); System.out.println("Realized GLAD: "+glad.getChosenGLCapabilities()); Assert.assertTrue("FBO drawable is initialized before ctx creation", !glad.isInitialized()); + glad.setFBOMode(fboMode); glad.display(); // initial display incl. init! { @@ -160,6 +192,9 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { } Assert.assertTrue("FBO drawable is not initialized after ctx creation", glad.isInitialized()); + // final boolean useTexture = 0 != ( GLFBODrawable.FBOMODE_USE_TEXTURE & glad.getFBOMode() ); + final boolean useDepth = 0 != ( GLFBODrawable.FBOMODE_USE_DEPTH & glad.getFBOMode() ); + // // FBO incl. MSAA is fully initialized now // @@ -179,20 +214,20 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { Assert.assertTrue("FBO Back is not initialized before ctx creation", fboBack.isInitialized()); if( chosenCaps.getDoubleBuffered() ) { - Assert.assertTrue("FBO are equal: "+fboFront+" == "+fboBack, !fboFront.equals(fboBack)); + Assert.assertNotEquals("FBO are equal: "+fboFront+" == "+fboBack, fboFront, fboBack); Assert.assertNotSame(fboFront, fboBack); } else { - Assert.assertTrue("FBO are not equal: "+fboFront+" != "+fboBack, fboFront.equals(fboBack)); + Assert.assertEquals("FBO are not equal: "+fboFront+" != "+fboBack, fboFront, fboBack); Assert.assertSame(fboFront, fboBack); } - final FBObject.TextureAttachment texAttachA, texAttachB; + final FBObject.Colorbuffer color0, color1; - texAttachA = glad.getTextureBuffer(GL.GL_FRONT); + color0 = glad.getColorbuffer(GL.GL_FRONT); if(0==glad.getNumSamples()) { - texAttachB = glad.getTextureBuffer(GL.GL_BACK); + color1 = glad.getColorbuffer(GL.GL_BACK); } else { - texAttachB = null; + color1 = null; } final FBObject.Colorbuffer colorA, colorB; @@ -203,19 +238,26 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { colorB = fboBack.getColorbuffer(0); Assert.assertNotNull(colorB); - depthA = fboFront.getDepthAttachment(); - Assert.assertNotNull(depthA); - depthB = fboBack.getDepthAttachment(); - Assert.assertNotNull(depthB); + if( useDepth ) { + depthA = fboFront.getDepthAttachment(); + Assert.assertNotNull(depthA); + depthB = fboBack.getDepthAttachment(); + Assert.assertNotNull(depthB); + } else { + depthA = null; + depthB = null; + } glad.display(); // SWAP_ODD if( chosenCaps.getDoubleBuffered() ) { // double buffer or MSAA - Assert.assertTrue("Color attachments are equal: "+colorB+" == "+colorA, !colorB.equals(colorA)); + Assert.assertNotEquals("Color attachments are equal: "+colorB+" == "+colorA, colorA, colorB); Assert.assertNotSame(colorB, colorA); - Assert.assertTrue("Depth attachments are equal: "+depthB+" == "+depthA, !depthB.equals(depthA)); - Assert.assertNotSame(depthB, depthA); + if( useDepth ) { + Assert.assertNotEquals("Depth attachments are equal: "+depthB+" == "+depthA, depthA, depthB); + Assert.assertNotSame(depthB, depthA); + } } else { // single buffer Assert.assertEquals(colorA, colorB); @@ -224,40 +266,40 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { Assert.assertSame(depthA, depthB); } - Assert.assertEquals(texAttachA, colorA); - Assert.assertSame(texAttachA, colorA); + Assert.assertEquals(color0, colorA); + Assert.assertSame(color0, colorA); if(0==glad.getNumSamples()) { - Assert.assertEquals(texAttachB, colorB); - Assert.assertSame(texAttachB, colorB); + Assert.assertEquals(color1, colorB); + Assert.assertSame(color1, colorB); } if( chosenCaps.getNumSamples() > 0 ) { // MSAA final FBObject _fboFront = glad.getFBObject(GL.GL_FRONT); final FBObject _fboBack = glad.getFBObject(GL.GL_BACK); - Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront.equals(_fboFront)); + Assert.assertEquals("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront, _fboFront); Assert.assertSame(fboFront, _fboFront); - Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboBack, fboBack.equals(_fboBack)); + Assert.assertEquals("FBO are not equal: "+fboBack+" != "+_fboBack, fboBack, _fboBack); Assert.assertSame(fboBack, _fboBack); } else if( chosenCaps.getDoubleBuffered() ) { // real double buffer final FBObject _fboFront = glad.getFBObject(GL.GL_FRONT); final FBObject _fboBack = glad.getFBObject(GL.GL_BACK); - Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack.equals(_fboFront)); + Assert.assertEquals("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack, _fboFront); Assert.assertSame(fboBack, _fboFront); - Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboBack, fboFront.equals(_fboBack)); + Assert.assertEquals("FBO are not equal: "+fboFront+" != "+_fboBack, fboFront, _fboBack); Assert.assertSame(fboFront, _fboBack); } else { // single buffer final FBObject _fboFront = glad.getFBObject(GL.GL_FRONT); final FBObject _fboBack = glad.getFBObject(GL.GL_BACK); - Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront.equals(_fboFront)); + Assert.assertEquals("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront, _fboFront); Assert.assertSame(fboFront, _fboFront); - Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack.equals(_fboFront)); + Assert.assertEquals("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack, _fboFront); Assert.assertSame(fboBack, _fboFront); - Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboBack, fboBack.equals(_fboBack)); + Assert.assertEquals("FBO are not equal: "+fboBack+" != "+_fboBack, fboBack, _fboBack); Assert.assertSame(fboBack, _fboBack); - Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboBack, fboFront.equals(_fboBack)); + Assert.assertEquals("FBO are not equal: "+fboFront+" != "+_fboBack, fboFront, _fboBack); Assert.assertSame(fboFront, _fboBack); } @@ -301,12 +343,16 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { FBObject.RenderAttachment _depth = _fboFront.getDepthAttachment(); System.err.println("Resize1.oldDepth "+depthA); System.err.println("Resize1.newDepth "+_depth); - Assert.assertNotNull(_depth); + if( useDepth ) { + Assert.assertNotNull(_depth); + } Assert.assertEquals(depthA, _depth); Assert.assertSame(depthA, _depth); _depth = _fboBack.getDepthAttachment(); - Assert.assertNotNull(_depth); + if( useDepth ) { + Assert.assertNotNull(_depth); + } Assert.assertEquals(depthB, _depth); Assert.assertSame(depthB, _depth); @@ -348,12 +394,16 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { Assert.assertSame(colorB, _color); FBObject.RenderAttachment _depth = fboBack.getDepthAttachment(); - Assert.assertNotNull(_depth); // MSAA back w/ depth + if( useDepth ) { + Assert.assertNotNull(_depth); // MSAA back w/ depth + } Assert.assertEquals(depthB, _depth); Assert.assertSame(depthB, _depth); _depth = fboFront.getDepthAttachment(); - Assert.assertNotNull(_depth); + if( useDepth ) { + Assert.assertNotNull(_depth); + } Assert.assertEquals(depthA, _depth); Assert.assertSame(depthA, _depth); @@ -364,7 +414,10 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { } // 6 + 7 (samples + display) - glad.setNumSamples(glad.getGL(), chosenCaps.getNumSamples() > 0 ? 0 : 4); // triggers repaint + final int oldSampleCount = chosenCaps.getNumSamples(); + final int newSampleCount = oldSampleCount > 0 ? 0 : 4; + System.out.println("Resize3.sampleCount: "+oldSampleCount+" -> "+newSampleCount); + glad.setNumSamples(glad.getGL(), newSampleCount); // triggers repaint snapshotGLEventListener.setMakeSnapshot(); glad.display(); // actual screenshot diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java index e1e1c3fbc..13feb2372 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java @@ -147,7 +147,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase { fbod1.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() { @Override public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) { - mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName()); + mixerDemo.setTexID0(fbod1.getColorbuffer(GL.GL_FRONT).getName()); } }); fbod1.display(); // init System.err.println("FBOD1 "+fbod1); @@ -163,15 +163,15 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase { fbod2.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() { @Override public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) { - mixerDemo.setTexID1(fbod2.getTextureBuffer(GL.GL_FRONT).getName()); + mixerDemo.setTexID1(fbod2.getColorbuffer(GL.GL_FRONT).getName()); } }); fbod2.display(); // init System.err.println("FBOD2 "+fbod2); Assert.assertTrue(fbod2.isInitialized()); // preinit texIDs - mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName()); - mixerDemo.setTexID1(fbod2.getTextureBuffer(GL.GL_FRONT).getName()); + mixerDemo.setTexID0(fbod1.getColorbuffer(GL.GL_FRONT).getName()); + mixerDemo.setTexID1(fbod2.getColorbuffer(GL.GL_FRONT).getName()); glWindow.addGLEventListener(mixerDemo); glWindow.addGLEventListener(new GLEventListener() { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java index c9c156218..4ed762a4e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java @@ -144,14 +144,14 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase { fbod1.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() { @Override public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) { - mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName()); + mixerDemo.setTexID0(fbod1.getColorbuffer(GL.GL_FRONT).getName()); } }); fbod1.display(); // init System.err.println("FBOD1 "+fbod1); Assert.assertTrue(fbod1.isInitialized()); // preinit texIDs - mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName()); + mixerDemo.setTexID0(fbod1.getColorbuffer(GL.GL_FRONT).getName()); glWindow.addWindowListener(new WindowAdapter() { @Override diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java index f00053989..6cd97239a 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java @@ -173,8 +173,8 @@ public class FBOMix2DemosES2 implements GLEventListener { fbo0.resetSamplingSink(gl); fbo1.attachColorbuffer(gl, 0, true); fbo1.resetSamplingSink(gl); - fbo0Tex = fbo0.getSamplingSink(); - fbo1Tex = fbo1.getSamplingSink(); + fbo0Tex = fbo0.getSamplingSink().getTextureAttachment(); + fbo1Tex = fbo1.getSamplingSink().getTextureAttachment(); } else { fbo0Tex = fbo0.attachTexture2D(gl, 0, true); fbo1Tex = fbo1.attachTexture2D(gl, 0, true); @@ -194,11 +194,11 @@ public class FBOMix2DemosES2 implements GLEventListener { } numSamples = fbo0.getNumSamples(); if(numSamples>0) { - fbo0Tex = fbo0.getSamplingSink(); - fbo1Tex = fbo1.getSamplingSink(); + fbo0Tex = fbo0.getSamplingSink().getTextureAttachment(); + fbo1Tex = fbo1.getSamplingSink().getTextureAttachment(); } else { - fbo0Tex = (TextureAttachment) fbo0.getColorbuffer(0); - fbo1Tex = (TextureAttachment) fbo1.getColorbuffer(0); + fbo0Tex = fbo0.getColorbuffer(0).getTextureAttachment(); + fbo1Tex = fbo1.getColorbuffer(0).getTextureAttachment(); } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java index 18cb35929..0c5d89e27 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java @@ -152,7 +152,7 @@ public class TextureDraw02ES2ListenerFBO implements GLEventListener { if(numSamples>0) { fbo0.attachColorbuffer(gl, 0, true); fbo0.resetSamplingSink(gl); - fbo0Tex = fbo0.getSamplingSink(); + fbo0Tex = fbo0.getSamplingSink().getTextureAttachment(); } else { fbo0Tex = fbo0.attachTexture2D(gl, 0, true); } @@ -165,9 +165,9 @@ public class TextureDraw02ES2ListenerFBO implements GLEventListener { fbo0.reset(gl, width, height, numSamples, true); numSamples = fbo0.getNumSamples(); if(numSamples>0) { - fbo0Tex = fbo0.getSamplingSink(); + fbo0Tex = fbo0.getSamplingSink().getTextureAttachment(); } else { - fbo0Tex = (TextureAttachment) fbo0.getColorbuffer(0); + fbo0Tex = fbo0.getColorbuffer(0).getTextureAttachment(); } } -- cgit v1.2.3