aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/jogl
diff options
context:
space:
mode:
Diffstat (limited to 'make/config/jogl')
-rw-r--r--make/config/jogl/cgl-macosx-CustomJavaCode.java20
-rw-r--r--make/config/jogl/cgl-macosx.cfg1
2 files changed, 21 insertions, 0 deletions
diff --git a/make/config/jogl/cgl-macosx-CustomJavaCode.java b/make/config/jogl/cgl-macosx-CustomJavaCode.java
index fc3ce1c57..2d9b1bd71 100644
--- a/make/config/jogl/cgl-macosx-CustomJavaCode.java
+++ b/make/config/jogl/cgl-macosx-CustomJavaCode.java
@@ -1,4 +1,24 @@
+/**
+ * Interface to C language function: <br> <code>void setContextView(NSOpenGLContext * ctx, NSView * view)</code>
+ * <p>
+ * A GLException is thrown if this method has not been called from the NSApplication Main-Thread.<br>
+ * Bug 1398: Such pre-emptive exception aligns behavior across all OSX variations,
+ * by complying to the newly enforced [NSOpenGLContext setView:] implementation
+ * which crashes with a SIGILL signal.
+ * </p>
+ */
+public static void setContextView(long ctx, long nsView) {
+ if( 0 == ctx ) {
+ throw new IllegalArgumentException("given ctx is null");
+ }
+ if( !OSXUtil.IsMainThread() ) {
+ throw new GLException("Not called from the NSApplication Main-Thread. Current Thread: "+Thread.currentThread());
+ }
+ setContextViewImpl(ctx, nsView);
+}
+
+
/**
* Creates the NSOpenGLLayer for FBO/PBuffer w/ optional GL3 shader program
* <p>
diff --git a/make/config/jogl/cgl-macosx.cfg b/make/config/jogl/cgl-macosx.cfg
index df39bdaab..e97838aff 100644
--- a/make/config/jogl/cgl-macosx.cfg
+++ b/make/config/jogl/cgl-macosx.cfg
@@ -37,6 +37,7 @@ Opaque long NSOpenGLLayer *
CustomCCode #include <machine/types.h>
CustomCCode #include "macosx-window-system.h"
+DelegateImplementation setContextView setContextViewImpl
DelegateImplementation createNSOpenGLLayer createNSOpenGLLayerImpl
DelegateImplementation setNSOpenGLLayerEnabled setNSOpenGLLayerEnabledImpl
DelegateImplementation releaseNSOpenGLLayer releaseNSOpenGLLayerImpl