aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-09 15:43:51 +0200
committerSven Gothel <[email protected]>2011-09-09 15:43:51 +0200
commit8def3e243401a0fe8ce606de6a54381a65626f15 (patch)
treef41e107ade84b5eedcd64063b997f791073d4117 /src/test/com/jogamp
parent2083ba25be5ce9b55cc2f5a420f17c3bb5ff1750 (diff)
*GLContext: resetStates(); getPlatformExtensionsString(); GLX/WGL NV_swap_group support; setSwapInterval();
resetStates() - fixes a bug where X11GLXContext impl. resetState() !! - marked all with @Override tag - ensured super.resetStates() is called at end (oops) getPlatformExtensionsStringImpl()* - fixes a bug where X11GLXContext overrides GLContext cached GLX extension string query - marked 'final' in GLContext to avoid bugs - using abstract 'getPlatformExtensionsStringImpl()' called by ExtensionAvailabilityCache Add premiliry GLX/WGL NV_swap_group support - thought it might be a solution to sync swap of 2 windows - none of my drivers/platforms support it, event though extension is avail on Linux Promote setSwapInterval() (1 up) - bumped above API up to public GLContext - those extension should not spam the GL interfaces .. hmm
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
index 7567679d4..296a3604a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
@@ -37,6 +37,7 @@ import java.nio.FloatBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLContext;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLUniformData;
@@ -173,6 +174,19 @@ public class GearsES2 implements GLEventListener {
new com.jogamp.newt.event.awt.AWTKeyAdapter(gearsKeys).addTo(comp);
}
st.useProgram(gl, false);
+
+ int[] maxVals = new int[] { -1, -1 } ;
+ GLContext glc = drawable.getContext();
+ boolean r = glc.queryMaxSwapGroups(maxVals, 0, maxVals, 1);
+ System.err.println("swap group max groups "+maxVals[0]+", barriers "+maxVals[0]+", "+r);
+ if(maxVals[0]>0) {
+ System.err.println("swap group joing 1: "+glc.joinSwapGroup(1));
+ if(maxVals[1]>0) {
+ System.err.println("swap group bind 1-1: "+glc.bindSwapBarrier(1, 1));
+ }
+ }
+ glc.setSwapInterval(swapInterval);
+
System.err.println(Thread.currentThread()+" GearsES2.init FIN");
}
@@ -181,8 +195,6 @@ public class GearsES2 implements GLEventListener {
Assert.assertEquals("not init or already disposed", true, initialized);
GL2ES2 gl = drawable.getGL().getGL2ES2();
- gl.setSwapInterval(swapInterval);
-
float h = (float)height / (float)width;
st.useProgram(gl, true);