aboutsummaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-01-31 08:57:26 +0000
committerKenneth Russel <[email protected]>2005-01-31 08:57:26 +0000
commit58cb43c6e0140be2f89e99743fe28a021ada9074 (patch)
tree456abe1f7339c140fdf37d12a16d6c9d6fd246ca /make
parent14878b7669c08fcf6137b64d07f17bfe1f41a214 (diff)
Fixed Issue 102: Fail to find cgShader environment with webstart
Incorporated suggestion from submitter to call System.loadLibrary() on cg and cgGL before calling System.loadLibrary() on jogl_cg. Hopefully this will help Java Web Started applications by allowing the person doing the deployment to also deploy the Cg runtime environment if desired. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@199 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make')
-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 }