diff options
author | Sven Gothel <[email protected]> | 2020-03-02 14:19:03 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-03-02 14:19:03 +0100 |
commit | 854924c72599aab8d8193b9cb2b85a25bd395a2d (patch) | |
tree | f41c38f44f7dadd54505b4003030ac1cee67a246 /make/config/jogl/cgl-macosx-CustomJavaCode.java | |
parent | 8ccea1f0ff48a39e806839330ebeb5369bc0c79a (diff) | |
parent | d1a4d790c89934616fa1883312b4064bda9fa420 (diff) |
Merge branch 'bug1398'
Diffstat (limited to 'make/config/jogl/cgl-macosx-CustomJavaCode.java')
-rw-r--r-- | make/config/jogl/cgl-macosx-CustomJavaCode.java | 20 |
1 files changed, 20 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> |