diff options
author | Kenneth Russel <[email protected]> | 2006-02-10 20:06:04 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-02-10 20:06:04 +0000 |
commit | 4b14f14cbb84c3d60d3fb501d78873c574eec6bd (patch) | |
tree | 2bac953157778f18e0eff06c4c01fe08e55d9076 /make | |
parent | c6ed1767abe191648219a403828ecf32ad5ad25e (diff) |
Made loading of GLU library lazier, partially in the hope that this
may address problems on certain Linux distributions where for some
reason we're falling back to software rendering with Mesa
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@595 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make')
-rw-r--r-- | make/build.xml | 8 | ||||
-rw-r--r-- | make/glu-CustomJavaCode.java | 11 | ||||
-rwxr-xr-x | make/glx-CustomCCode.c | 11 | ||||
-rw-r--r-- | make/glx-x11.cfg | 1 |
4 files changed, 27 insertions, 4 deletions
diff --git a/make/build.xml b/make/build.xml index 1e7d614f1..1f251e82d 100644 --- a/make/build.xml +++ b/make/build.xml @@ -701,19 +701,19 @@ <!-- linker configuration --> <linker id="linker.cfg.linux" name="gcc"> - <syslibset dir="/usr/X11R6/lib" libs="GL, GLU, X11"/> + <syslibset dir="/usr/X11R6/lib" libs="GL, X11"/> <syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" /> <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/> </linker> <linker id="linker.cfg.linux.amd64" name="gcc"> - <syslibset dir="/usr/X11R6/lib64" libs="GL, GLU, X11"/> + <syslibset dir="/usr/X11R6/lib64" libs="GL, X11"/> <syslibset dir="/usr/X11R6/lib64" libs="Xxf86vm" /> <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/> </linker> <linker id="linker.cfg.solaris" name="suncc"> - <syslibset libs="GL, GLU, X11"/> + <syslibset libs="GL, X11"/> </linker> <linker id="linker.cfg.win32.mingw" name="gcc" incremental="false"> @@ -727,7 +727,7 @@ <linkerarg value="/SUBSYSTEM:WINDOWS" /> <!-- output is not a console app as uses WinMain entry point --> <linkerarg value="/MACHINE:IX86" /> <!-- explicity set target platform --> - <syslibset libs="opengl32, glu32, gdi32, user32, kernel32" /> + <syslibset libs="opengl32, gdi32, user32, kernel32" /> <syslibset dir="${windows.cg.lib}" libs="cg, cgGL" if="c.compiler.use-cglib"/> </linker> diff --git a/make/glu-CustomJavaCode.java b/make/glu-CustomJavaCode.java index ffa3a0242..1ea4f20b9 100644 --- a/make/glu-CustomJavaCode.java +++ b/make/glu-CustomJavaCode.java @@ -1432,8 +1432,12 @@ public int gluScaleImage(int format, int wIn, int hIn, int typeIn, java.nio.Buff // private static GLUProcAddressTable gluProcAddressTable; +private static volatile boolean gluLibraryLoaded; private static GLUProcAddressTable getGLUProcAddressTable() { + if (!gluLibraryLoaded) { + loadGLULibrary(); + } if (gluProcAddressTable == null) { GLUProcAddressTable tmp = new GLUProcAddressTable(); ProcAddressHelper.resetProcAddressTable(tmp, GLDrawableFactoryImpl.getFactoryImpl()); @@ -1441,3 +1445,10 @@ private static GLUProcAddressTable getGLUProcAddressTable() { } return gluProcAddressTable; } + +private static synchronized void loadGLULibrary() { + if (!gluLibraryLoaded) { + GLDrawableFactoryImpl.getFactoryImpl().loadGLULibrary(); + gluLibraryLoaded = true; + } +} diff --git a/make/glx-CustomCCode.c b/make/glx-CustomCCode.c index 504b8432f..791927604 100755 --- a/make/glx-CustomCCode.c +++ b/make/glx-CustomCCode.c @@ -51,6 +51,17 @@ JNIEXPORT jlong JNICALL Java_com_sun_opengl_impl_x11_GLX_RootWindow(JNIEnv *env, jclass _unused, jlong display, jint screen) { return RootWindow((Display*) (intptr_t) display, screen); } + +JNIEXPORT jlong JNICALL +Java_com_sun_opengl_impl_x11_GLX_dlopen(JNIEnv *env, jclass _unused, jstring name) { + const jbyte* chars; + void* res; + chars = (*env)->GetStringUTFChars(env, name, NULL); + res = dlopen(chars, RTLD_LAZY | RTLD_GLOBAL); + (*env)->ReleaseStringUTFChars(env, name, chars); + return (jlong) ((intptr_t) res); +} + JNIEXPORT jlong JNICALL Java_com_sun_opengl_impl_x11_GLX_dlsym(JNIEnv *env, jclass _unused, jstring name) { const jbyte* chars; diff --git a/make/glx-x11.cfg b/make/glx-x11.cfg index 5680a419a..93ff2d02f 100644 --- a/make/glx-x11.cfg +++ b/make/glx-x11.cfg @@ -13,6 +13,7 @@ SkipProcAddressGen glXGetProcAddressARB CustomJavaCode GLX private static GLXProcAddressTable glxProcAddressTable = new GLXProcAddressTable(); CustomJavaCode GLX public static GLXProcAddressTable getGLXProcAddressTable() { return glxProcAddressTable; } +CustomJavaCode GLX public static native long dlopen(String name); CustomJavaCode GLX public static native long dlsym(String name); IncludeAs CustomCCode glx-CustomCCode.c |