tags:

views:

180

answers:

1

I'm writing a desktop app using JOGL, and deploying on Win/Mac/Linux. On Linux we find that the OpenGL libraries installed are not always up to the job, and we need to have the capability of switching our own software emulation OpenGL in. Naturally we expected that we could place out libraries after /usr/lib or before /usr/lib to favour ours or the default.

It turns out that ours are picked up preferentially by JOGL. Does anyone know if the JOGl libraries do special processing looking for libGL etc, favouring perhaps a later version over an earlier? Any information welcome.

+2  A: 

I assume that the Java side of JOGL uses JNI (Java Native Interface) to interface with the native libraries. JNI uses ths Java system variable java.library.path to find native libraries. You could set it on the command line using the -D switch when running your Java app:

java -Djava.library.path=/some/path mypackage.MyProgram

It could also be that the native system doesn't pick up the right OpenGL libraries itself. On Linux, you can set the environment variable LD_LIBRARY_PATH to specify where Linux should look for shared libraries. This page explains more (see section 3.3.1).

Note that you can get the source code of JOGL on the JOGL homepage, so if you really want to know, you could download it and start digging into it.

(why is there a stupid limitation "new users can only post one hyperlink"????)

Jesper