Skip navigation links

@NonnullDefault

Package org.lwjgl.opengl

Contains bindings to the OpenGL cross-platform 2D and 3D rendering API.

See: Description

Package org.lwjgl.opengl Description

Contains bindings to the OpenGL cross-platform 2D and 3D rendering API.

The OpenGL registry is a useful online resource that contains the OpenGL and OpenGL Shading Language specifications, as well as specifications of OpenGL extensions. The OpenGL Reference Pages is another convenient source of documentation.

The bindings of the core OpenGL functionality are contained in two distinct class hierarchies:

Each of the above classes extends the class of the previous OpenGL version in the corresponding hierarchy.

The recommended way to write OpenGL applications with LWJGL is to statically import the class that corresponds to the minimum required OpenGL version. This will expose all symbols up to that version. Additional functionality (later core versions or extensions) should be guarded with appropriate checks using the GLCapabilities instance of the OpenGL context.

The Compatibility Profile and Core Profile class hierarchies should not be mixed with static imports, as that would result in compilation ambiguities when resolving the symbols. Note that the Compatibility Profile hierarchy can be used with a Core Profile context (as long as no deprecated symbol is used) and the Core Profile hierarchy can be used with a Compatibility Profile context. The recommendation is to use the Compatibility Profile hierarchy only when deprecated functionality is required. In any other case, the Core Profile hierarchy should be preferred.

For example, an OpenGL application that requires OpenGL 3.3, must use modern OpenGL features only and needs the best possible performance:

Skip navigation links

Copyright LWJGL. All Rights Reserved. License terms.