The basic interface to OpenGL, providing access to core functionality up through the OpenGL 2.0 specification as well as all vendor extensions.
While the APIs for vendor extensions are unconditionally exposed, the underlying functions may not be present. The method {@link #isFunctionAvailable} should be used to query theavailability of any non-core function before it is used for the first time; for example, gl.isFunctionAvailable("glProgramStringARB")
. On certain platforms (Windows in particular), the most "core" functionality is only OpenGL 1.1, so in theory any routines first exposed in OpenGL 1.2, 1.3, and 1.4, 1.5, or 2.0 as well as vendor extensions should all be queried. Calling an unavailable function will cause a {@link GLException} to be raised.
{@link #isExtensionAvailable} may also be used to determine whethera specific extension is available before calling the routines or using the functionality it exposes: for example,
gl.isExtensionAvailable("GL_ARB_vertex_program");
. However, in this case it is up to the end user to know which routines or functionality are associated with which OpenGL extensions. It may also be used to test for the availability of a particular version of OpenGL: for example,
gl.isExtensionAvailable("GL_VERSION_1_5");
.
Exceptions to the window system extension naming rules:
- The memory allocators for the NVidia vertex_array_range (VAR) extension, in particular
wglAllocateMemoryNV
/ glXAllocateMemoryNV
and associated routines. {@link #glAllocateMemoryNV} has been provided for window system-independentaccess to VAR. {@link #isFunctionAvailable} will translate an argumentof "glAllocateMemoryNV" or "glFreeMemoryNV" into the appropriate window system-specific name. - WGL_ARB_pbuffer, WGL_ARB_pixel_format, and other platform-specific pbuffer functionality; the availability of pbuffers can be queried on Windows, X11 and Mac OS X platforms by querying {@link #isExtensionAvailable} with an argument of"GL_ARB_pbuffer" or "GL_ARB_pixel_format".