Heteroclinic.net logo

www.heteroclinic.net

Setting and Using JOGL
1

201611

JOGL[1] provides Java bindings to the OpenGL(R) API. It is handy to use it and develop computer graphics programs. It saves us a lot time that spent on resolving C compiler issues across different platforms. It also has comprehensive test suite that we can refer to and use its examples as a reliable foundation.

We can use JOGL directly in a Maven project. But it is good to compile the library ourselves and check the unit tests. Here is how to set up the compilation environment in Centos 6.

During the compilation, you can observe the amazing unit tests from JOGL.

[1] https://jogamp.org/

Setting and Using JOGL
2

201611

The following are how to set up a Ubuntu fresh installation to complie JOGL.



Setting and Using JOGL
3

201611

Notice, in the up-to-date Ubuntu distro, e.g. 16.04 in this case, we only get OpenGL 3.0. Also in this case, our hardware is an ATI HD 4650 card. The community driver from Ubuntu only supports this version of OpenGL. To achieve higher version of OpenGL, we have to install the proprietary driver from ATI. Due to conflicts, we also have to downgrade(install older version, not exactly downgrade) Ubuntu to 14.04. Then install the ATI driver. Note, even we install Ubuntu 14.04, we still have to downgrade Xorg as in the previous section.



Setting and Using JOGL
4

201611

The compilation of JOGL and running unit tests on Centos and Ubuntu are basically the same. At the same time, we can use Eclipse IDE open the projects and exam the source code. It will be good to build project JOAL, Gluegen, JOGL in sequence. If we try to run the JOGL JUnit tests from the IDE, we have to add all the jars in folder gluegen/build folder in the "Java Build Path" of JOGL project as "Libraries" in Eclipse by "Add External JARs".