(4/5/2008) Updated to include latest JOGL features like the TextureIO and Screenshot classes.
These examples demonstrate basic JOGL functionality. The intent is to illustrate features that are unique to JOGL, not to demonstrate OpenGL programming. A summary of each example, along with a screenshot is listed below. The source code for all of the examples is available in the above jar file.
An example of the basic JOGL GLEventListener framework. This example creates a JFrame containing a single GLCanvas and makes it visible. The GL events (init, display, and resize) cause output to the console. Nothing is drawn to the canvas. In addition, the JOGL version is output to the console.
Draws a multi-colored triangle to the GLCanvas. As in the previous example, the GLCanvas is placed in a JFrame and made visible. This time OpenGL functions are called in the init, reshape and display methods to set up the OpenGL environment and draw the triangle. See the source for more info.
This example shows how to mix a GLCanvas with other Swing components such as buttons and menus.
The FPSAnimator class provides a thread that will generate redisplay events at a certain rate. This example demonstrates basic animation using the FPSAnimator class.
JOGL's composable pipelines are useful tools when developing. There are two examples in this package that demonstrate the use of DebugGL and TraceGL.
Loading and using textures in JOGL. This utilizes TextureIO for image file loading. It also demonstrates the use of JOGL TextureCoords, to avoid inverted textures.
This example illustrates the use of an offscreen drawable as a texture.
Demonstrates the use of multiple drawables, and how to share data between them.
When array data (buffers) need to be passed to or from OpenGL, JOGL usually gives you two choices. You can use basic Java arrays, or you can use buffer objects from java.nio. This example demonstrates vertex arrays in JOGL using java.nio buffers for the storage of vertex data.
Using the JOGL class Screenshot to programatically capture a screenshot of a running JOGL app, and display in a GUI or save to a file.