diff options
Diffstat (limited to 'make/config/jogl/cgl-macosx-CustomJavaCode.java')
-rw-r--r-- | make/config/jogl/cgl-macosx-CustomJavaCode.java | 22 |
1 files changed, 22 insertions, 0 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) { |