diff options
Diffstat (limited to 'make')
-rw-r--r-- | make/config/jogl/cgl-macosx-CustomJavaCode.java | 20 | ||||
-rw-r--r-- | make/config/jogl/cgl-macosx.cfg | 1 | ||||
-rw-r--r-- | make/scripts/tests.sh | 10 | ||||
-rw-r--r-- | make/stub_includes/opengl/macosx-window-system.h | 9 |
4 files changed, 32 insertions, 8 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 diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 220662262..83553b564 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -111,6 +111,7 @@ function jrun() { #X_ARGS="--illegal-access=warn" #D_ARGS="-Djogl.debug.GLProfile -Djogl.debug.GLContext" + D_ARGS="-Djogl.debug.GLContext -Dnativewindow.debug.OSXUtil.MainThreadChecker" #D_ARGS="-Djogl.debug.GLProfile" #D_ARGS="-Djogl.debug.DebugGL" #D_ARGS="-Djogl.debug.TraceGL" @@ -156,7 +157,7 @@ function jrun() { #D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" #D_ARGS="-Dnativewindow.debug.SWT" - D_ARGS="-Dnativewindow.debug.SWT -Dnewt.debug.Window -Djogl.debug.GLCanvas" + #D_ARGS="-Dnativewindow.debug.SWT -Dnewt.debug.Window -Djogl.debug.GLCanvas" #D_ARGS="-Dnativewindow.debug.SWT -Dnewt.debug.Window -Djogl.debug.GLCanvas -Dswt.autoScale=200" #export GDK_DPI_SCALE=2 #D_ARGS="-Dnativewindow.debug.SWT -Dnativewindow.debug.X11Util -Dnewt.debug.Window" @@ -488,7 +489,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2SimpleNEWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $* -testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $* +#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $* #testswt com.jogamp.opengl.test.junit.jogl.swt.TestGLCanvasSWTNewtCanvasSWTPosInTabs $* #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestRulerNEWT01 $* @@ -964,6 +965,11 @@ testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasA #testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug572AWT $* #testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit02AWT $* #testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersAWTCanvas $* +# +# OSX Bug 1398 +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2NEWT1 $* +#testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT10 $* +testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* # Linux DRM/GBM # diff --git a/make/stub_includes/opengl/macosx-window-system.h b/make/stub_includes/opengl/macosx-window-system.h index 96643fca3..d8147a000 100644 --- a/make/stub_includes/opengl/macosx-window-system.h +++ b/make/stub_includes/opengl/macosx-window-system.h @@ -30,12 +30,9 @@ NSOpenGLContext* getCurrentContext(void); CGLContextObj getCGLContext(NSOpenGLContext* ctx); NSView* getNSView(NSOpenGLContext* ctx); -NSOpenGLContext* createContext(NSOpenGLContext* shareContext, - NSView* nsView, - Bool incompleteView, - NSOpenGLPixelFormat* pixelFormat, - Bool opaque, - int* viewNotReady); +NSOpenGLContext* createContext(NSOpenGLContext* share, + NSOpenGLPixelFormat* fmt, + Bool opaque); void setContextView(NSOpenGLContext* ctx, NSView* view); void clearDrawable(NSOpenGLContext* ctx); Bool makeCurrentContext(NSOpenGLContext* ctx); |