aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-01-05 18:09:41 +0100
committerSven Gothel <[email protected]>2014-01-05 18:09:41 +0100
commit20b242387e6c329a2ba6261d39a05ffe9c39c6ab (patch)
tree4be1a896732a1de446dcb8f1e29cb73745efee21 /src
parent82961bc22cd01d7d8b931c33cefe780b9498292c (diff)
NativewindowCommon_init: Add define STDERR_TO_FILE (default undefined) to redirect stderr to file jogamp_stderr.log (Useful for Applets)
Diffstat (limited to 'src')
-rw-r--r--src/nativewindow/native/NativewindowCommon.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nativewindow/native/NativewindowCommon.c b/src/nativewindow/native/NativewindowCommon.c
index 212bdf82f..ec7ee7728 100644
--- a/src/nativewindow/native/NativewindowCommon.c
+++ b/src/nativewindow/native/NativewindowCommon.c
@@ -3,6 +3,8 @@
#include <string.h>
#include <sys/time.h>
+// #define STDERR_TO_FILE 1
+
static const char * const ClazzNameRuntimeException = "java/lang/RuntimeException";
static jclass runtimeExceptionClz=NULL;
@@ -42,6 +44,11 @@ int NativewindowCommon_init(JNIEnv *env) {
if(NULL==runtimeExceptionClz) {
NativewindowCommon_FatalError(env, "Nativewindow: can't use %s", ClazzNameRuntimeException);
}
+ #ifdef STDERR_TO_FILE
+ FILE * old_stderr = stderr;
+ FILE * new_stderr = freopen("jogamp_stderr.log", "w", stderr);
+ fprintf(stderr, "STDERR_TO_FILE: %p -> %p\n", old_stderr, new_stderr);
+ #endif
return 1;
}
return 0;