Suvarna Garge (Editor)

Java Bindings for OpenGL

Updated on
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

Java Binding for the OpenGL API is a JSR API specification (JSR 231) for the Java Platform, Standard Edition which allows to use OpenGL on the Java (software platform). There is also Java Binding for the OpenGL ES API (JSR 239) for the Java Platform, Micro Edition.


Programming concepts

Core OpenGL API and GLU library calls are available from Java through a thin wrapper looking very much as the original OpenGL C API, Except GLU NURBS routines which are not exposed through the public API.

All platform specific libraries (available from the CGL API for Mac OS X, GLX for X Window System, and WGL for Microsoft Windows) are also abstracted out to create a platform independent way of selecting Framebuffer attributes and performing platform specific Framebuffer operations.

Platform-specific extensions are not included in the public API. Each implementation can choose to export some of these APIs via the GL.getPlatformGLExtensions() and GL.getExtension(String) method calls which return Objects whose data types are specific to the given implementation.


This example shows how to draw a polygon (without initialization or repaint code). Here is the reference C implementation:

Which translates to the following Java implementation:


  • Java OpenGL : The reference implementation, available on Microsoft Windows, Linux, Mac OS X, and Solaris platforms.
  • References

    Java Bindings for OpenGL Wikipedia