JOGL Tutorial

OpenGL

OpenGL is one of the standard APIs for generating 2D and 3D computer graphics. It is cross-platform and language-independent. It provides the bulk of functions used to generate and modify images and graphics. It is the most widely adopted graphics API for drawing 2D and 3D graphics with transformations, coloring, effects.

Features of OpenGL:

  1. OpenGL provides the functionality to draw primitives as well as transformations.
  2. OpenGL is an industry-standard multi-platform and vendor-neutral.
  3. OpenGL is reliable and portable.
  4. OpenGL applications can run on any target machine. This makes it scalable.
  5. OpenGL is easy to use and well documented.
  6. It has binding with different languages like C++ and Java.

OpenGL Bindings:

  • GL4java:

The GL4java is mainly a game-focused OpenGL binding. It has binding with OpenGL 1.3 and all vendor extensions. It supports integration with AWT and Swing. It is a single-window and full-screen application.

  • LWJGL:

It is used for mobile phones and embedded devices. The full form of LWJGL is Light Weight Java Game Library. It has tie-up with OpenGL 1.5. It works well for all versions of Java but it provides limited functionality of AWT and Swing.

  • JOGL:

JOGL supports 2D and 3D graphics with the support of all OpenGL libraries. It provides transformations, coloring, lighting, texture facilities.

JOGL

JOGL stands for Java Open Graphics Library. It is basically a java package having the support of OpenGL libraries. It allows programmers to perform computer graphics functions with object-oriented tools available in java to accelerate 2D and 3D graphics. JOGL provides a facility for programmers to embed computer graphics code in java applications. JOGL is a wrapper library having the support of all OpenGL functions. JOGL renders 2D and 3D vector graphics. For achieving Fast speed and high-quality rendering JOGL interacts with Graphics Processing Unit (GPU). It is used for creating 3D graphics programs such as screensavers and real-time games.

All the OpenGL features in JOGL are accessible through Java Native Interface (JNI). The GlueGen tool provides auto-generated code to JOGL. It provides implementation on multiple platforms using different languages to focus more on efficiency. Only recent versions of the Java Platform are supported by JOGL. It provides integration with Java AWT, Standard Widget Toolkit (SWT), and Swing. AWT GLCanvas and NewtCanvasAWT integration are available with JOGL. For Swing integration it provides GLJPanel. JOGL allows using of lightweight and valuable Swing components such as Menus and Tooltips. For SWT integration SWT GLCanvas is used. It has its own Native Windowing Toolkit popularly known as NEWT. It improves user performance in heavy java graphics programs.

History of JOGL

MIT graduate scholars, Ken Russell and Chris Kline initially proposed Open Graphics Library, JOGL.

Further development of JOGL project was done by the gaming group of Sun Microsystems.

Nowadays, JOGL is maintained by Java on Graphics, Audio, Media, and processing popularly known as JogAmp.

Features of JOGL

  1. JOGL provides 2D and 3D rendering.
  2. JOGL has its own Native Windowing Toolkit (NEWT). It also supports Graphics Utility Library (GUL), GL Utility Toolkit (GLUT).
  3. JOGL provides full access to all OpenGL APIs versions.
  4. JOGL provides complete support for windowing.
  5. JOGL includes a composable pipeline model for simple debugging.
  6. JOGL is an open-source project freely available to all users.

Advantages of JOGL:

  1. JOGL supports a rich set of libraries including GLU, GLUT, and NEWT.
  2. JOGL provides accessibility for all OpenGL API.
  3. AWT-free image management is provided by JOGL.
  4. JOGL is platform-independent.
  5. It provides hardware-accelerated graphics.

Disadvantages of JOGL:

  1. Color-indexed modes are not supported in JOGL.
  2. The JOGL supports the latest versions of java platforms. It only supports J2SE 1.4 and later.
  3. JOGL doesn’t include interface collaborating with input-output.
  4. Sound interfaces are not supported in JOGL.
  5. Prior knowledge of OpenGL is required.

Applications of JOGL:

  1. GeoGebra: It is the mathematical software used for educational purposes to learn geometry, algebra, and statistics concepts. It has 3D support provided with JOGL and OpenGL.
  2. NASA World Wind: It is a kind of 3D virtual globe for interacting with geographic data. Online demos with simulators available developed using JOGL.
  3. FROG: It is used for data visualization in physics. It helps to provide animations in CMS experiments.

Ticket to Ride and Jake2 are some popular games developed using JOGL for desktop computers.

Java OpenGL Index