aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-08-30 04:55:12 +0200
committerSven Gothel <[email protected]>2015-08-30 04:55:12 +0200
commit2db11ad80582af8715071b47b5331b79001d511c (patch)
treeb21c5a684068b20b8e7bcaea890182b4f9e06f10 /src/test/com/jogamp/opengl
parent3ac457a3a9074a70bf428bb6a5674b8f70d268b1 (diff)
Bug 1207 - GLDebugMessageHandler: Support GL_KHR_debug for Desktop and ES profile
GL_KHR_debug <https://www.opengl.org/registry/specs/KHR/debug.txt> GL_KHR_debug shall be favorized before - GL_ARB_debug_output - GL_AMD_debug_output Allow GL_KHR_debug for GL2GL3 and GL2ES2 profiles, i.e. including ES profiles: GLES2, GLES3. GL_ARB_debug_output and GL_AMD_debug_output are only allowed for desktop GL2GL3 profiles.
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java85
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java65
2 files changed, 128 insertions, 22 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java
index dcee114e5..8319a1c22 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java
@@ -32,7 +32,6 @@ import java.io.IOException;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2ES2;
-import com.jogamp.opengl.GL2GL3;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLContext;
import com.jogamp.opengl.GLDebugListener;
@@ -58,6 +57,14 @@ public class TestGLDebug00NEWT extends UITestCase {
static String dbgTstMsg0 = "Hello World";
static int dbgTstId0 = 42;
+ static GLProfile getGLProfile(final String profile) {
+ if( !GLProfile.isAvailable(profile) ) {
+ System.err.println("Profile "+profile+" n/a");
+ return null;
+ }
+ return GLProfile.get(profile);
+ }
+
public static class WindowContext {
public final Window window;
public final GLContext context;
@@ -115,9 +122,7 @@ public class TestGLDebug00NEWT extends UITestCase {
}
- void test01GLDebug01EnableDisable(final boolean enable) throws InterruptedException {
- final GLProfile glp = GLProfile.getDefault();
-
+ void testX1GLDebugEnableDisable(final GLProfile glp, final boolean enable) throws InterruptedException {
final WindowContext winctx = createWindow(glp, enable);
final String glDebugExt = winctx.context.getGLDebugMessageExtension();
System.err.println("glDebug extension: "+glDebugExt);
@@ -131,19 +136,42 @@ public class TestGLDebug00NEWT extends UITestCase {
}
@Test
- public void test01GLDebugDisabled() throws InterruptedException {
- test01GLDebug01EnableDisable(false);
+ public void test01GL2GL3DebugDisabled() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GL2GL3);
+ if( null == glp ) {
+ return;
+ }
+ testX1GLDebugEnableDisable(glp, false);
}
@Test
- public void test01GLDebugEnabled() throws InterruptedException {
- test01GLDebug01EnableDisable(true);
+ public void test02GL2GL3DebugEnabled() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GL2GL3);
+ if( null == glp ) {
+ return;
+ }
+ testX1GLDebugEnableDisable(glp, true);
}
@Test
- public void test02GLDebugError() throws InterruptedException {
- final GLProfile glp = GLProfile.getDefault();
+ public void test11GLES2DebugDisabled() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GLES2);
+ if( null == glp ) {
+ return;
+ }
+ testX1GLDebugEnableDisable(glp, false);
+ }
+
+ @Test
+ public void test12GLES2DebugEnabled() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GLES2);
+ if( null == glp ) {
+ return;
+ }
+ testX1GLDebugEnableDisable(glp, true);
+ }
+ void testX2GLDebugError(final GLProfile glp) throws InterruptedException {
final WindowContext winctx = createWindow(glp, true);
final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
@@ -164,8 +192,24 @@ public class TestGLDebug00NEWT extends UITestCase {
}
@Test
- public void test03GLDebugInsert() throws InterruptedException {
- final GLProfile glp = GLProfile.getDefault();
+ public void test03GL2GL3DebugError() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GL2GL3);
+ if( null == glp ) {
+ return;
+ }
+ testX2GLDebugError(glp);
+ }
+
+ @Test
+ public void test13GLES2DebugError() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GLES2);
+ if( null == glp ) {
+ return;
+ }
+ testX2GLDebugError(glp);
+ }
+
+ void testX3GLDebugInsert(final GLProfile glp) throws InterruptedException {
final WindowContext winctx = createWindow(glp, true);
final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg0, dbgTstId0);
winctx.context.addGLDebugListener(myGLDebugListener);
@@ -184,6 +228,23 @@ public class TestGLDebug00NEWT extends UITestCase {
destroyWindow(winctx);
}
+ @Test
+ public void test04GL2GL3DebugInsert() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GL2GL3);
+ if( null == glp ) {
+ return;
+ }
+ testX3GLDebugInsert(glp);
+ }
+
+ @Test
+ public void test14GLES2DebugInsert() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GLES2);
+ if( null == glp ) {
+ return;
+ }
+ testX3GLDebugInsert(glp);
+ }
public static void main(final String args[]) throws IOException {
final String tstname = TestGLDebug00NEWT.class.getName();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java
index 66733209c..43d207a0d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java
@@ -31,7 +31,6 @@ package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
import com.jogamp.opengl.GL2ES2;
-import com.jogamp.opengl.GL2GL3;
import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLContext;
@@ -54,6 +53,14 @@ public class TestGLDebug01NEWT extends UITestCase {
static String dbgTstMsg0 = "Hello World";
static int dbgTstId0 = 42;
+ static GLProfile getGLProfile(final String profile) {
+ if( !GLProfile.isAvailable(profile) ) {
+ System.err.println("Profile "+profile+" n/a");
+ return null;
+ }
+ return GLProfile.get(profile);
+ }
+
GLWindow createWindow(final GLProfile glp, final boolean debugGL) {
final GLCapabilities caps = new GLCapabilities(glp);
//
@@ -76,9 +83,7 @@ public class TestGLDebug01NEWT extends UITestCase {
}
- void test01GLDebug01EnableDisable(final boolean enable, final String dbgTstMsg, final int dbgTstId) throws InterruptedException {
- final GLProfile glp = GLProfile.getDefault();
-
+ void testX1GLDebugEnableDisable(final GLProfile glp, final boolean enable, final String dbgTstMsg, final int dbgTstId) throws InterruptedException {
final GLWindow window = createWindow(glp, enable);
final GLContext ctx = window.getContext();
final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg, dbgTstId);
@@ -109,19 +114,42 @@ public class TestGLDebug01NEWT extends UITestCase {
}
@Test
- public void test01GLDebug01Disabled() throws InterruptedException {
- test01GLDebug01EnableDisable(false, null, -1);
+ public void test01GL2GL3DebugDisabled() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GL2GL3);
+ if( null == glp ) {
+ return;
+ }
+ testX1GLDebugEnableDisable(glp, false, null, -1);
}
@Test
- public void test01GLDebug01Enabled() throws InterruptedException {
- test01GLDebug01EnableDisable(true, dbgTstMsg0, dbgTstId0);
+ public void test02GL2GL3DebugEnabled() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GL2GL3);
+ if( null == glp ) {
+ return;
+ }
+ testX1GLDebugEnableDisable(glp, true, dbgTstMsg0, dbgTstId0);
}
@Test
- public void test02GLDebug01Error() throws InterruptedException {
- final GLProfile glp = GLProfile.getDefault();
+ public void test11GLES2DebugDisabled() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GLES2);
+ if( null == glp ) {
+ return;
+ }
+ testX1GLDebugEnableDisable(glp, false, null, -1);
+ }
+ @Test
+ public void test12GLES2DebugEnabled() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GLES2);
+ if( null == glp ) {
+ return;
+ }
+ testX1GLDebugEnableDisable(glp, true, dbgTstMsg0, dbgTstId0);
+ }
+
+ void testX3GLDebugError(final GLProfile glp) throws InterruptedException {
final GLWindow window = createWindow(glp, true);
final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
@@ -144,6 +172,23 @@ public class TestGLDebug01NEWT extends UITestCase {
destroyWindow(window);
}
+ @Test
+ public void test03GL2GL3DebugError() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GL2GL3);
+ if( null == glp ) {
+ return;
+ }
+ testX3GLDebugError(glp);
+ }
+
+ @Test
+ public void test13GLES2DebugError() throws InterruptedException {
+ final GLProfile glp = getGLProfile(GLProfile.GLES2);
+ if( null == glp ) {
+ return;
+ }
+ testX3GLDebugError(glp);
+ }
public static void main(final String args[]) throws IOException {
final String tstname = TestGLDebug01NEWT.class.getName();