From a4c7bf0420e369e71561d2847f2fc444ce5abafa Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 20 Feb 2012 18:03:36 +0100 Subject: API Change [GLProfile/GLContext]: Add notion of hardware acceleration in GLProfile.get() methods. We need to distinguish between software and hardware accelerated OpenGL profiles to allow choosing the proper profiles [default, GL2ES1, GL2ES2, ..] on platforms where both, software and hardware implementations exist (GL, GLES2, ..). Where no preference is being requested, hardware acceleration is favored: GLProfile.getDefault() GLProfile.getGL2ES1() GLProfile.getGL2ES2() Some method signatures needed to change GLProfile: getMaxProgrammable(AbstractGraphicsDevice device) -> getMaxProgrammable(AbstractGraphicsDevice device, boolean favorHardwareRasterizer) GLProfile adds: isHardwareRasterizer() Determination whether a hardware acceleration is being used or not is extended in GLContextImpl by querying the current context's GL_RENDERER string. If the latter contains 'software' (case insensitive) it is not hardware accelerated. At least this works w/ newer Mesa3D impl, where GLX_SLOW_CONFIG is not set! --- .../com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java | 2 +- .../test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java index a30171f0d..2c89ec7f6 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java @@ -87,7 +87,7 @@ public class TestGLProfile01NEWT extends UITestCase { @Test public void testGLProfileMaxProgrammable() throws InterruptedException { // Assuming at least one programmable profile is available - GLProfile glp = GLProfile.getMaxProgrammable(); + GLProfile glp = GLProfile.getMaxProgrammable(true); System.out.println("GLProfile.getMaxProgrammable(): "+glp); if(glp.getName().equals(GLProfile.GL4)) { Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4)); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java index 904fdc7f6..2f6025a63 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java @@ -83,7 +83,7 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase { final static String glps = GLProfile.GL3; private NEWTGLContext.WindowContext prepareTest() throws GLException, InterruptedException { - final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(GLProfile.getMaxProgrammable(), 480, 480, debugGL); + final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(GLProfile.getMaxProgrammable(true), 480, 480, debugGL); if(!winctx.context.getGL().isGL3()) { System.err.println("GL3 not available"); cleanupTest(winctx); -- cgit v1.2.3