summaryrefslogtreecommitdiffstats
path: root/src/jogl/native
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-28 22:09:31 +0200
committerSven Gothel <[email protected]>2011-04-28 22:09:31 +0200
commit39a8ca392d7302831f5689979c4ce89145b732af (patch)
treec338e8565169b871bbe8830c752bd19283eec9b3 /src/jogl/native
parent23bc6204b5e518e397e4ee4cdbe06f789970ee4f (diff)
GLContext GLDebugMessages: Add synchronous status/dumpStack; Remove length in aliased glDebugMessageInsert.
- GLDebugMessages add synchronous status - defaults to true - GLContext/GLDebugMessages add dumpStack() if jogl.debug.DebugGL is set - Remove param length in aliased glDebugMessageInsert.
Diffstat (limited to 'src/jogl/native')
-rw-r--r--src/jogl/native/GLDebugMessageHandler.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/jogl/native/GLDebugMessageHandler.c b/src/jogl/native/GLDebugMessageHandler.c
index 22a7433f9..790871111 100644
--- a/src/jogl/native/GLDebugMessageHandler.c
+++ b/src/jogl/native/GLDebugMessageHandler.c
@@ -1,10 +1,22 @@
+#include <stdlib.h>
+#include <stdarg.h>
+
#include "jogamp_opengl_GLDebugMessageHandler.h"
#include "JoglCommon.h"
#include <GL/gl.h>
#include <GL/glext.h>
+// #define VERBOSE_ON 1
+
+#ifdef VERBOSE_ON
+ #define DBG_PRINT(...) fprintf(stderr, __VA_ARGS__); fflush(stderr)
+#else
+ #define DBG_PRINT(...)
+#endif
+
+
static jmethodID glDebugMessageARB = NULL; // int source, int type, int id, int severity, String msg
static jmethodID glDebugMessageAMD = NULL; // int id, int category, int severity, String msg
@@ -52,6 +64,7 @@ static void GLDebugMessageARBCallback(GLenum source, GLenum type, GLuint id, GLe
JNIEnv *curEnv = NULL;
JNIEnv *newEnv = NULL;
int envRes ;
+ DBG_PRINT("GLDebugMessageARBCallback: 01 - %s\n", message);
// retrieve this thread's JNIEnv curEnv - or detect it's detached
envRes = (*vm)->GetEnv(vm, (void **) &curEnv, version) ;
@@ -62,6 +75,7 @@ static void GLDebugMessageARBCallback(GLenum source, GLenum type, GLuint id, GLe
return;
}
curEnv = newEnv;
+ DBG_PRINT("GLDebugMessageARBCallback: 02 - attached .. \n");
} else if( JNI_OK != envRes ) {
// oops ..
fprintf(stderr, "GLDebugMessageARBCallback: can't GetEnv: %d\n", envRes);
@@ -73,7 +87,13 @@ static void GLDebugMessageARBCallback(GLenum source, GLenum type, GLuint id, GLe
if( NULL != newEnv ) {
// detached attached thread
(*vm)->DetachCurrentThread(vm);
+ DBG_PRINT("GLDebugMessageARBCallback: 04 - detached .. \n");
}
+ DBG_PRINT("GLDebugMessageARBCallback: 0X\n");
+ /**
+ * On Java 32bit on 64bit Windows and w/ GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB disables,
+ * the unit test com.jogamp.opengl.test.junit.jogl.acore.TestGLDebug00NEWT crashes after this point.
+ */
}
// GLDEBUGAMD(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
@@ -108,6 +128,10 @@ static void GLDebugMessageAMDCallback(GLuint id, GLenum category, GLenum severit
// detached attached thread
(*vm)->DetachCurrentThread(vm);
}
+ /**
+ * On Java 32bit on 64bit Windows,
+ * the unit test com.jogamp.opengl.test.junit.jogl.acore.TestGLDebug00NEWT crashes after this point.
+ */
}