aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/jogl/cgl-macosx-CustomJavaCode.java
diff options
context:
space:
mode:
Diffstat (limited to 'make/config/jogl/cgl-macosx-CustomJavaCode.java')
-rw-r--r--make/config/jogl/cgl-macosx-CustomJavaCode.java22
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
new file mode 100644
index 000000000..b9a37d0c6
--- /dev/null
+++ b/make/config/jogl/cgl-macosx-CustomJavaCode.java
@@ -0,0 +1,22 @@
+
+/**
+ * Creates the NSOpenGLLayer for FBO/PBuffer w/ optional GL3 shader program on Main-Thread
+ */
+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) {
+ return OSXUtil.RunOnMainThread(true, new Function<Long, Object>() {
+ public Long eval(Object... args) {
+ return Long.valueOf( createNSOpenGLLayerImpl(ctx, gl3ShaderProgramName, fmt, p, texID, opaque, texWidth, texHeight) );
+ } } ).longValue();
+}
+
+/**
+ * Releases the NSOpenGLLayer on Main-Thread
+ */
+public static void releaseNSOpenGLLayer(final long nsOpenGLLayer) {
+ OSXUtil.RunOnMainThread(true, new Runnable() {
+ public void run() {
+ releaseNSOpenGLLayerImpl(nsOpenGLLayer);
+ } } );
+}
+