From dc2deb071ca192594426791e95804a208e030ce3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 25 Oct 2013 00:01:12 +0200 Subject: Bug 867 OSX [Common Code]: Trigger GLRendererQuirks.GL4NeedsGL3Request and make it sticky; Only alias profiles if HW-Accelerated! Only alias profiles if HW-Accelerated! GLContextImpl.mapGLVersions(..) shall not map a higher profile to a lower if it is a software renderer. +++ GLContextImpl.mapGLVersions(..) attempts to trigger GLRendererQuirks.GL4NeedsGL3Request if OSX 10.9 by creating a GL3 core context first. +++ GLContextImpl.setGLFunctionAvailability(): - On OSX 10.9: Detect GLRendererQuirks.GL4NeedsGL3Request and make it sticky (per device) while 'withinGLVersionsMapping' - Merge sticky quirks w/ local quirks +++ TestGearsES2NEWT: Add cmdline '-gl2' to force GL2 profile. --- .../jogl/demos/es2/newt/TestGearsES2NEWT.java | 68 ++++++++++++---------- 1 file changed, 37 insertions(+), 31 deletions(-) (limited to 'src/test/com/jogamp') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java index 74be176da..b54a2cd19 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,12 +20,12 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. */ - + package com.jogamp.opengl.test.junit.jogl.demos.es2.newt; import java.io.IOException; @@ -70,7 +70,7 @@ import org.junit.FixMethodOrder; import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class TestGearsES2NEWT extends UITestCase { +public class TestGearsES2NEWT extends UITestCase { static int screenIdx = 0; static PointImmutable wpos; static DimensionImmutable wsize, rwsize=null; @@ -92,12 +92,13 @@ public class TestGearsES2NEWT extends UITestCase { static boolean forceES2 = false; static boolean forceES3 = false; static boolean forceGL3 = false; + static boolean forceGL2 = false; static boolean mainRun = false; static boolean exclusiveContext = false; static boolean useAnimator = true; static enum SysExit { none, testExit, testError, displayExit, displayError }; static SysExit sysExit = SysExit.none; - + @BeforeClass public static void initClass() { if(null == wsize) { @@ -129,7 +130,7 @@ public class TestGearsES2NEWT extends UITestCase { final GearsES2 demo = new GearsES2(swapInterval); demo.setPMVUseBackingArray(pmvUseBackingArray); glWindow.addGLEventListener(demo); - + final SnapshotGLEventListener snap = new SnapshotGLEventListener(); glWindow.addGLEventListener(snap); if(waitForKey) { @@ -154,7 +155,7 @@ public class TestGearsES2NEWT extends UITestCase { animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD); animator.setExclusiveContext(exclusiveContext); } - + QuitAdapter quitAdapter = new QuitAdapter(); //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter)); //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter)); @@ -167,9 +168,9 @@ public class TestGearsES2NEWT extends UITestCase { } public void windowMoved(WindowEvent e) { System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); - } + } }); - + glWindow.addKeyListener(new KeyAdapter() { @Override public void keyPressed(final KeyEvent e) { @@ -299,7 +300,7 @@ public class TestGearsES2NEWT extends UITestCase { throw new Error("test error send from GLEventListener"); } else if ( SysExit.displayExit == sysExit ) { System.err.println("exit(0) send from GLEventListener"); - System.exit(0); + System.exit(0); } } } else { @@ -307,29 +308,29 @@ public class TestGearsES2NEWT extends UITestCase { } } @Override - public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { } + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { } }); } - + glWindow.setVisible(true); if( useAnimator ) { animator.setUpdateFPSFrames(60, showFPS ? System.err : null); } - + System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities()); System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); - + snap.setMakeSnapshot(); if( null != rwsize ) { - Thread.sleep(500); // 500ms delay + Thread.sleep(500); // 500ms delay glWindow.setSize(rwsize.getWidth(), rwsize.getHeight()); System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); } - + snap.setMakeSnapshot(); - + final long t0 = System.currentTimeMillis(); long t1 = t0; while(!quitAdapter.shouldQuit() && t1-t0