summaryrefslogtreecommitdiffstats
path: root/make/cg-common.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'make/cg-common.cfg')
-rw-r--r--make/cg-common.cfg17
1 files changed, 16 insertions, 1 deletions
diff --git a/make/cg-common.cfg b/make/cg-common.cfg
index 043822838..315dda214 100644
--- a/make/cg-common.cfg
+++ b/make/cg-common.cfg
@@ -55,6 +55,8 @@ Ignore cgGetParameterValues
# Need to import New IO for Buffer classes
#
Import java.nio.*
+# and java.security.* to allow unsigned Cg applications
+Import java.security.*
# Raise CgException instead of RuntimeException in glue code
RuntimeExceptionType CgException
@@ -67,4 +69,17 @@ RuntimeExceptionType CgException
CustomCCode #include <stdlib.h>
CustomCCode #include <Cg/cgGL.h>
-CustomJavaCode CgGL static { System.loadLibrary("jogl_cg");}
+CustomJavaCode CgGL static {
+CustomJavaCode CgGL AccessController.doPrivileged(new PrivilegedAction() {
+CustomJavaCode CgGL public Object run() {
+CustomJavaCode CgGL // Workaround so that these don't need to be in the system
+CustomJavaCode CgGL // path but can be referenced from java.library.path
+CustomJavaCode CgGL // (this is intended to help with Webstarted applications)
+CustomJavaCode CgGL System.loadLibrary("cg");
+CustomJavaCode CgGL System.loadLibrary("cgGL");
+CustomJavaCode CgGL // Load the actual Cg binding
+CustomJavaCode CgGL System.loadLibrary("jogl_cg");
+CustomJavaCode CgGL return null;
+CustomJavaCode CgGL }
+CustomJavaCode CgGL });
+CustomJavaCode CgGL }