Using OpenGL in SWT Applications
Java OpenGL Bindings (SWT 3.2 and newer)
Support for OpenGL is included in SWT as of Eclipse 3.2 in the package
org.eclipse.swt.opengl. See the GLCanvas class for
a widget which hosts an OpenGL context.
OpenGL applications use two separate APIs: the window-system
independent drawing API (OpenGL), and a window-system specific
integration layer (WGL under Windows, GLX under X, etc). SWT
provides a thin layer above the window-system specific integration API,
enabling applications to use their Java OpenGL binding of choice.
- The Lightweight Java Game Library
(LWJGL) is a Java binding for OpenGL which supports OpenGL 2.0 and
many interesting extensions. For an example using LWJGL with SWT, see
- JOGL is a Java binding for OpenGL.
For an example using JOGL with SWT, see
- gljava is a Java binding
for OpenGL which aims to be simple and thin. gljava is reported to work
well with SWT.
The Experimental org.eclipse.opengl Binding (pre-SWT 3.2)
Prior to Eclipse 3.2 there were experimental packages (available below) that facilitated the use of OpenGL in SWT.
To run the OpenGL view example, simply extract the zip and the
org.eclipse.opengl plugin to your Eclipse plugins folder. To run the standalone
example, download the examples zip along with the org.eclipse.opengl zip for
your platform and import them into your workspace. There is also a stand-alone snippet that uses this package
If you are using SWT 3.2 or newer then you should use the supported OpenGL binding that is
included in the SWT package instead of these experimental downloads which are not supported.
| Deprecated OpenGL Binding for SWT (Experimental)