summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make/config/jogl/cgl-macosx-CustomJavaCode.java22
-rw-r--r--make/config/jogl/cgl-macosx.cfg2
-rwxr-xr-xmake/scripts/tests.sh4
-rw-r--r--make/stub_includes/opengl/macosx-window-system.h1
4 files changed, 27 insertions, 2 deletions
diff --git a/make/config/jogl/cgl-macosx-CustomJavaCode.java b/make/config/jogl/cgl-macosx-CustomJavaCode.java
index b9a37d0c6..d32e0ae8f 100644
--- a/make/config/jogl/cgl-macosx-CustomJavaCode.java
+++ b/make/config/jogl/cgl-macosx-CustomJavaCode.java
@@ -1,6 +1,14 @@
/**
* Creates the NSOpenGLLayer for FBO/PBuffer w/ optional GL3 shader program on Main-Thread
+ * <p>
+ * It is mandatory that the shared context handle <code>ctx</code>
+ * is not locked while calling this method.
+ * </p>
+ * <p>
+ * The NSOpenGLLayer starts in enabled mode,
+ * you may enable/disable it via {@link #setNSOpenGLLayerEnabled(long, boolean)}.
+ * </p>
*/
public static long createNSOpenGLLayer(final long ctx, final int gl3ShaderProgramName, final long fmt, final long p,
final int texID, final boolean opaque, final int texWidth, final int texHeight) {
@@ -11,6 +19,20 @@ public static long createNSOpenGLLayer(final long ctx, final int gl3ShaderProgra
}
/**
+ * Enable or disable NSOpenGLLayer.
+ *
+ * <p>
+ * If disabled, the NSOpenGLLayer will not be displayed, i.e. rendered.
+ * </p>
+ */
+public static void setNSOpenGLLayerEnabled(final long nsOpenGLLayer, final boolean enable) {
+ OSXUtil.RunOnMainThread(true, new Runnable() {
+ public void run() {
+ setNSOpenGLLayerEnabledImpl(nsOpenGLLayer, enable);
+ } } );
+}
+
+/**
* Releases the NSOpenGLLayer on Main-Thread
*/
public static void releaseNSOpenGLLayer(final long nsOpenGLLayer) {
diff --git a/make/config/jogl/cgl-macosx.cfg b/make/config/jogl/cgl-macosx.cfg
index 98123f605..edb5bfbbf 100644
--- a/make/config/jogl/cgl-macosx.cfg
+++ b/make/config/jogl/cgl-macosx.cfg
@@ -35,8 +35,10 @@ CustomCCode #include </usr/include/machine/types.h>
CustomCCode #include "macosx-window-system.h"
AccessControl createNSOpenGLLayerImpl PRIVATE
+AccessControl setNSOpenGLLayerEnabledImpl PRIVATE
AccessControl releaseNSOpenGLLayerImpl PRIVATE
RenameJavaMethod createNSOpenGLLayer createNSOpenGLLayerImpl
+RenameJavaMethod setNSOpenGLLayerEnabled setNSOpenGLLayerEnabledImpl
RenameJavaMethod releaseNSOpenGLLayer releaseNSOpenGLLayerImpl
IncludeAs CustomJavaCode CGL cgl-macosx-CustomJavaCode.java
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 559c2aa6a..a20ec507c 100755
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -301,8 +301,8 @@ function testawtswt() {
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext12FPSAnimNEWT $*
#testawt com.jogamp.opengl.test.junit.jogl.acore.TestOffscreenLayer01GLCanvasAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.acore.TestOffscreenLayer02NewtCanvasAWT $*
-#testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove01GLCanvasSwingAWT $*
-testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove02GLWindowNewtCanvasAWT $*
+testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove01GLCanvasSwingAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove02GLWindowNewtCanvasAWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateOnOffscrnCapsNEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableFactoryOffscrnCapsNEWT $*
diff --git a/make/stub_includes/opengl/macosx-window-system.h b/make/stub_includes/opengl/macosx-window-system.h
index a2da66878..402a16efc 100644
--- a/make/stub_includes/opengl/macosx-window-system.h
+++ b/make/stub_includes/opengl/macosx-window-system.h
@@ -56,6 +56,7 @@ void setContextTextureImageToPBuffer(NSOpenGLContext* ctx, NSOpenGLPixelBuffer*
Bool isNSOpenGLPixelBuffer(uint64_t object);
NSOpenGLLayer* createNSOpenGLLayer(NSOpenGLContext* ctx, int gl3ShaderProgramName, NSOpenGLPixelFormat* fmt, NSOpenGLPixelBuffer* p, uint32_t texID, Bool opaque, int texWidth, int texHeight);
+void setNSOpenGLLayerEnabled(NSOpenGLLayer* layer, Bool enable);
void setNSOpenGLLayerSwapInterval(NSOpenGLLayer* layer, int interval);
void waitUntilNSOpenGLLayerIsReady(NSOpenGLLayer* layer, long to_micros);
void setNSOpenGLLayerNeedsDisplayFBO(NSOpenGLLayer* layer, uint32_t texID);