diff options
author | Sven Gothel <[email protected]> | 2013-09-07 16:50:39 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-09-07 16:50:39 +0200 |
commit | 42500210d8a8626ee6c3c1b169eaa9e5fbf85a21 (patch) | |
tree | 147bc80a9c6095cd6022fed5198a971d5e491342 /src | |
parent | 4b5e77961d1c660f3537f4041fc1a3ce47ef105c (diff) |
Complete commit 54dcdf1f53c9fc1f7124cf77bbf5aa952d42053a, exposing GL2ES3 in GLProfile (just a query, no new profile)
Diffstat (limited to 'src')
9 files changed, 31 insertions, 29 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java index 092e2abf0..e85f04092 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java @@ -46,20 +46,13 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil { * @param alpha */ public AWTGLReadBufferUtil(GLProfile glp, boolean alpha) { - super(new AWTGLPixelBuffer.AWTGLPixelBufferProvider( glp.isGL2GL3() || glp.isGL3ES3() /* allowRowStride */ ), alpha, false); + super(new AWTGLPixelBuffer.AWTGLPixelBufferProvider( glp.isGL2ES3() /* allowRowStride */ ), alpha, false); } public AWTGLPixelBuffer getAWTGLPixelBuffer() { return (AWTGLPixelBuffer)this.getPixelBuffer(); } public BufferedImage readPixelsToBufferedImage(GL gl, boolean awtOrientation) { - if( readPixels(gl, awtOrientation) ) { - final BufferedImage image = getAWTGLPixelBuffer().image; - if( getTextureData().getMustFlipVertically() ) { - ImageUtil.flipImageVertically(image); - } - return image; - } - return null; + return readPixelsToBufferedImage(gl, 0, 0, 0, 0, awtOrientation); } public BufferedImage readPixelsToBufferedImage(GL gl, int inX, int inY, int inWidth, int inHeight, boolean awtOrientation) { if( readPixels(gl, inX, inY, inWidth, inHeight, awtOrientation) ) { diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java index df8ac5934..3748cd336 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java @@ -1125,7 +1125,7 @@ public class TextureIO { pixelFormat = image.getGLFormat(); } if (internalFormat == 0) { - if(glp.isGL2GL3()) { + if(glp.isGL2ES3()) { internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA8:GL.GL_RGB8; } else { internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB; @@ -1162,7 +1162,7 @@ public class TextureIO { pixelFormat = image.getGLFormat(); } if (internalFormat == 0) { - if(glp.isGL2GL3()) { + if(glp.isGL2ES3()) { internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA8:GL.GL_RGB8; } else { internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB; @@ -1199,7 +1199,7 @@ public class TextureIO { pixelFormat = image.getGLFormat(); } if (internalFormat == 0) { - if(glp.isGL2GL3()) { + if(glp.isGL2ES3()) { internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA8:GL.GL_RGB8; } else { internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB; diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index f6c03b537..618ee2584 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -1115,8 +1115,7 @@ public abstract class GLContext { /** * Indicates whether this GLContext is capable of GL2ES3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL3ES3, GL2, GL2GL3 ].</p> - * @see GLProfile#isGL3ES3() - * @see GLProfile#isGL2GL3() + * @see GLProfile#isGL2ES3() */ public final boolean isGL2ES3() { return isGL3ES3() || isGL2GL3(); diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index e3078271e..b5e89a23b 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -1128,6 +1128,15 @@ public class GLProfile { return GL2ES2 == profile || isGLES2() || isGL2GL3(); } + /** + * Indicates whether this profile is capable of GL2ES3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL3ES3, GL2, GL2GL3 ].</p> + * @see isGL3ES3() + * @see isGL2GL3() + */ + public final boolean isGL2ES3() { + return isGL3ES3() || isGL2GL3(); + } + /** Indicates whether this profile is capable of GL3ES3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3 ].</p> */ public final boolean isGL3ES3() { return isGL4ES3() || isGL3(); 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 004201905..93713c783 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 @@ -36,6 +36,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import javax.media.opengl.GL; +import javax.media.opengl.GL2ES2; import javax.media.opengl.GL2GL3; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLDrawable; @@ -280,8 +281,8 @@ public class TestGPUMemSec01NEWT extends UITestCase { @Test public void testReadPixelsGL2GL3_640x480xRGBxUB() throws InterruptedException { GLProfile glp = GLProfile.getGL2ES2(); - if(!glp.isGL2GL3()) { - System.err.println("GL2GL3 n/a skip test"); + if(!glp.isGL2ES3()) { + System.err.println("GL2ES3 n/a skip test"); return; } final int width = 640; @@ -304,8 +305,8 @@ public class TestGPUMemSec01NEWT extends UITestCase { @Test public void testReadPixelsGL2GL3_99x100xRGBxUB() throws InterruptedException { GLProfile glp = GLProfile.getGL2ES2(); - if(!glp.isGL2GL3()) { - System.err.println("GL2GL3 n/a skip test"); + if(!glp.isGL2ES3()) { + System.err.println("GL2ES3 n/a skip test"); return; } final int wwidth = 640; @@ -330,8 +331,8 @@ public class TestGPUMemSec01NEWT extends UITestCase { @Test public void testReadPixelsGL2GL3_640x480xREDxUB() throws InterruptedException { GLProfile glp = GLProfile.getGL2ES2(); - if(!glp.isGL2GL3()) { - System.err.println("GL2GL3 n/a skip test"); + if(!glp.isGL2ES3()) { + System.err.println("GL2ES3 n/a skip test"); return; } final int width = 640; @@ -343,7 +344,7 @@ public class TestGPUMemSec01NEWT extends UITestCase { final GL2GL3 gl = winctx.context.getGL().getGL2GL3(); // 2 x too small - 0 x alignment - Assert.assertEquals(2, readPixelsCheck(gl, GL2GL3.GL_RED, GL.GL_UNSIGNED_BYTE, 1, width, height)); + Assert.assertEquals(2, readPixelsCheck(gl, GL2ES2.GL_RED, GL.GL_UNSIGNED_BYTE, 1, width, height)); drawable.swapBuffers(); Thread.sleep(50); @@ -354,8 +355,8 @@ public class TestGPUMemSec01NEWT extends UITestCase { @Test public void testReadPixelsGL2GL3_102x100xREDxUB() throws InterruptedException { GLProfile glp = GLProfile.getGL2ES2(); - if(!glp.isGL2GL3()) { - System.err.println("GL2GL3 n/a skip test"); + if(!glp.isGL2ES3()) { + System.err.println("GL2ES3 n/a skip test"); return; } int wwidth = 640; @@ -369,7 +370,7 @@ public class TestGPUMemSec01NEWT extends UITestCase { final GL2GL3 gl = winctx.context.getGL().getGL2GL3(); // 2 x too small - 2 x alignment - Assert.assertEquals(4, readPixelsCheck(gl, GL2GL3.GL_RED, GL.GL_UNSIGNED_BYTE, 1, rwidth, rheight)); + Assert.assertEquals(4, readPixelsCheck(gl, GL2ES2.GL_RED, GL.GL_UNSIGNED_BYTE, 1, rwidth, rheight)); drawable.swapBuffers(); Thread.sleep(50); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java index d9e0496b3..e48fc783e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java @@ -98,7 +98,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase { } if( initSingleBuffer ) { - singleAWTGLPixelBufferProvider = new SingleAWTGLPixelBufferProvider( glp.isGL2GL3() /* allowRowStride */); + singleAWTGLPixelBufferProvider = new SingleAWTGLPixelBufferProvider( glp.isGL2ES3() /* allowRowStride */); singleAWTGLPixelBufferProvider.initSingleton(4, 600, 600, 1, true); } else { singleAWTGLPixelBufferProvider = null; diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java index 69252915c..6c4885308 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java @@ -70,8 +70,8 @@ public class TestElektronenMultipliziererNEWT extends UITestCase { @BeforeClass public static void initClass() { GLProfile glp = GLProfile.getDefault(); - if( ! ( glp.isHardwareRasterizer() && glp.isGL2GL3() ) ) { - // Sorry .. mobile is too slow for this one. + if( ! ( glp.isHardwareRasterizer() && glp.isGL2ES3() ) ) { + // Sorry .. mobile ES2 is too slow for this one. setTestSupported(false); return; } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java index 483ae6d9b..8289cc381 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java @@ -83,7 +83,7 @@ public class TestJPEGImage01NEWT extends UITestCase { } final int internalFormat; - if(glp.isGL2GL3()) { + if(glp.isGL2ES3()) { internalFormat = hasAlpha ? GL.GL_RGBA8 : GL.GL_RGB8; } else { internalFormat = hasAlpha ? GL.GL_RGBA : GL.GL_RGB; diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage01NEWT.java index f8808559f..91ace8420 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage01NEWT.java @@ -83,7 +83,7 @@ public class TestPNGImage01NEWT extends UITestCase { } final int internalFormat; - if(glp.isGL2GL3()) { + if(glp.isGL2ES3()) { internalFormat = hasAlpha ? GL.GL_RGBA8 : GL.GL_RGB8; } else { internalFormat = hasAlpha ? GL.GL_RGBA : GL.GL_RGB; |