The base interface from which all GL profiles derive, providing checked conversion down to concrete profiles, access to the OpenGL context associated with the GL and extension/function availability queries as described below.
While the APIs for vendor extensions are unconditionally
exposed, the underlying functions may not be present. The method
isFunctionAvailable should be used to query the
availability 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 GLException to be raised.
isExtensionAvailable may also be used to determine whether
a 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:
isExtensionAvailable with an argument of
"GL_ARB_pbuffer" or "GL_ARB_pixel_format".
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the GL buffer name bound to a target viaGL#glBindBuffer(int, int) or 0 if unbound.a GL buffer (VBO) target as used in target)GL#glBindBuffer(int, int), ie GL#GL_ELEMENT_ARRAY_BUFFER, GL#GL_ARRAY_BUFFER, ..
|
| public int | getBoundFramebuffer(int target)
Return the framebuffer name bound to this context,
see |
| public GLBufferStorage | Returns: the size of the given GL buffer storage, seeGLBufferStoragea GL buffer name, generated with e.g. bufferName)GL#glGenBuffers(int, int[], int) and used in GL#glBindBuffer(int, int), GL#glBufferData(int, long, java. or GL2#glNamedBufferDataEXT(int, long, java..
|
| public GLContext | |
| public int | |
| public int | getDefaultReadBuffer()
Returns the default color buffer within the current bound
For offscreen framebuffer objects this is |
| public int | |
| public GL | getDownstreamGL()
Returns the downstream GL instance in case this is a wrapping pipeline, otherwise |
| public Object | getExtension(String extensionName)
Returns an object providing access to the specified OpenGL extension. |
| public GL | |
| public GL2 | |
| public GL2ES1 | |
| public GL2ES2 | |
| public GL2ES3 | |
| public GL2GL3 | |
| public GL3 | |
| public GL3bc | |
| public GL3ES3 | |
| public GL4 | |
| public GL4bc | |
| public GL4ES3 | |
| public GLES1 | |
| public GLES2 | |
| public GLES3 | |
| public GLProfile | |
| public int | getMaxRenderbufferSamples()
Returns the maximum number of FBO RENDERBUFFER samples
if |
| public Object | getPlatformGLExtensions()
Returns an object through which platform-specific OpenGL extensions (EGL, GLX, WGL, etc.) may be accessed. |
| public GL | getRootGL()
Returns the implementing root instance, considering a wrapped pipelined hierarchy, see |
| public int | |
| public void | glClearDepth(double depth)
Aliased entrypoint of |
| public void | glDepthRange(double zNear, double zFar)
Aliased entrypoint of |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | isExtensionAvailable(String
the name of the OpenGL extension (e.g.,
"GL_ARB_vertex_program"). glExtensionName)Returns true if the specified OpenGL extension can be used successfully through this GL instance given the current host (OpenGL client) and display (OpenGL server) configuration. |
| public boolean | isFunctionAvailable(String
the name of the OpenGL function (e.g., use
"glBindRenderbufferEXT" or "glBindRenderbuffer" to check if glFunctionName)GL#glBindRenderbuffer(int, int) is available).Returns true if the specified OpenGL core- or extension-function can be used successfully through this GL instance given the current host (OpenGL client) and display (OpenGL server) configuration. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | isGL2ES3()
Indicates whether this GL object conforms to a either a GL2GL3 or GL3ES3 compatible profile. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | isGL4ES3()
Returns true if this GL object conforms to a GL4ES3 compatible profile, i.e. if |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if this context is an ES2 context or implements the extensionGL_ARB_ES2_compatibility, otherwise falseIndicates whether this GL object is compatible with the core OpenGL ES2 functionality. |
| public boolean | |
| public boolean | isGLES31Compatible()
Indicates whether this GL object is compatible with the core OpenGL ES3.1 functionality. |
| public boolean | isGLES32Compatible()
Indicates whether this GL object is compatible with the core OpenGL ES3.2 functionality. |
| public boolean | isGLES3Compatible()
Indicates whether this GL object is compatible with the core OpenGL ES3 functionality. |
| public boolean | isNPOTTextureAvailable()
Returns true if the GL context supports non power of two (NPOT) textures, otherwise false. |
| public boolean | |
| public boolean | Returns: true if a VBO is bound toGL#GL_ARRAY_BUFFER via GL#glBindBuffer(int, int), otherwise false
|
| public boolean | Returns: true if a VBO is bound toGL#GL_ELEMENT_ARRAY_BUFFER via GL#glBindBuffer(int, int), otherwise false
|
| public GLBufferStorage | mapBuffer(int
denotes the buffer via it's bound target target, int the mapping access mode access)Returns the |
| public GLBufferStorage | mapBufferRange(final int
denotes the buffer via it's bound target target, final long offset of the mapped buffer's storage offset, final long length of the mapped buffer's storage length, final int the mapping access mode access)Returns the |
| public void | Returns: true if the operation was successful, otherwise falsesee above interval)Set the swap interval of the current context and attached onscreen |
| getBoundBuffer | back to summary |
|---|---|
public int getBoundBuffer(int target)
| |
| getBoundFramebuffer | back to summary |
|---|---|
| public int getBoundFramebuffer(int target) Return the framebuffer name bound to this context,
see | |
| getBufferStorage | back to summary |
|---|---|
public GLBufferStorage getBufferStorage(int bufferName)
| |
| getContext | back to summary |
|---|---|
| public GLContext getContext() Returns the GLContext associated which this GL object. | |
| getDefaultDrawFramebuffer | back to summary |
|---|---|
| public int getDefaultDrawFramebuffer() Return the default draw framebuffer name.
May differ from it's default | |
| getDefaultReadBuffer | back to summary |
|---|---|
| public int getDefaultReadBuffer() Returns the default color buffer within the current bound
For offscreen framebuffer objects this is
Note-1: Neither ES1 nor ES2 supports selecting the read buffer via glReadBuffer
and
Note-2: ES3 only supports
Note-3: See | |
| getDefaultReadFramebuffer | back to summary |
|---|---|
| public int getDefaultReadFramebuffer() Return the default read framebuffer name.
May differ from it's default | |
| getDownstreamGL | back to summary |
|---|---|
| public GL getDownstreamGL() throws GLException Returns the downstream GL instance in case this is a wrapping pipeline, otherwise
See
| |
| getExtension | back to summary |
|---|---|
| public Object getExtension(String extensionName) Returns an object providing access to the specified OpenGL extension. This is intended to provide a mechanism for vendors who wish to provide access to new OpenGL extensions without changing the public API of the core package. For example, a user may request access to extension "GL_VENDOR_foo" and receive back an object which implements a vendor-specified interface which can call the OpenGL extension functions corresponding to that extension. It is up to the vendor to specify both the extension name and Java API for accessing it, including which class or interface contains the functions. Note it is the intent to add new extensions as quickly as possible to the core GL API. Therefore it is unlikely that most vendors will use this extension mechanism, but it is being provided for completeness. | |
| getGL | back to summary |
|---|---|
| public GL getGL() throws GLException Casts this object to the GL interface.
| |
| getGL2 | back to summary |
|---|---|
| public GL2 getGL2() throws GLException Casts this object to the GL2 interface.
| |
| getGL2ES1 | back to summary |
|---|---|
| public GL2ES1 getGL2ES1() throws GLException Casts this object to the GL2ES1 interface.
| |
| getGL2ES2 | back to summary |
|---|---|
| public GL2ES2 getGL2ES2() throws GLException Casts this object to the GL2ES2 interface.
| |
| getGL2ES3 | back to summary |
|---|---|
| public GL2ES3 getGL2ES3() throws GLException Casts this object to the GL2ES3 interface.
| |
| getGL2GL3 | back to summary |
|---|---|
| public GL2GL3 getGL2GL3() throws GLException Casts this object to the GL2GL3 interface.
| |
| getGL3 | back to summary |
|---|---|
| public GL3 getGL3() throws GLException Casts this object to the GL3 interface.
| |
| getGL3bc | back to summary |
|---|---|
| public GL3bc getGL3bc() throws GLException Casts this object to the GL3bc interface.
| |
| getGL3ES3 | back to summary |
|---|---|
| public GL3ES3 getGL3ES3() throws GLException Casts this object to the GL3ES3 interface.
| |
| getGL4 | back to summary |
|---|---|
| public GL4 getGL4() throws GLException Casts this object to the GL4 interface.
| |
| getGL4bc | back to summary |
|---|---|
| public GL4bc getGL4bc() throws GLException Casts this object to the GL4bc interface.
| |
| getGL4ES3 | back to summary |
|---|---|
| public GL4ES3 getGL4ES3() throws GLException Casts this object to the GL4ES3 interface.
| |
| getGLES1 | back to summary |
|---|---|
| public GLES1 getGLES1() throws GLException Casts this object to the GLES1 interface.
| |
| getGLES2 | back to summary |
|---|---|
| public GLES2 getGLES2() throws GLException Casts this object to the GLES2 interface.
| |
| getGLES3 | back to summary |
|---|---|
| public GLES3 getGLES3() throws GLException Casts this object to the GLES3 interface.
| |
| getGLProfile | back to summary |
|---|---|
| public GLProfile getGLProfile() Returns the GLProfile associated with this GL object. | |
| getMaxRenderbufferSamples | back to summary |
|---|---|
| public int getMaxRenderbufferSamples() Returns the maximum number of FBO RENDERBUFFER samples
if | |
| getPlatformGLExtensions | back to summary |
|---|---|
| public Object getPlatformGLExtensions() Returns an object through which platform-specific OpenGL extensions (EGL, GLX, WGL, etc.) may be accessed. The data type of the returned object and its associated capabilities are undefined. Most applications will never need to call this method. It is highly recommended that any applications which do call this method perform all accesses on the returned object reflectively to guard themselves against changes to the implementation. | |
| getRootGL | back to summary |
|---|---|
| public GL getRootGL() throws GLException Returns the implementing root instance, considering a wrapped pipelined hierarchy, see If this instance is not a wrapping pipeline, i.e. has no downstream instance, this instance is returned.
| |
| getSwapInterval | back to summary |
|---|---|
| public int getSwapInterval() Return the current swap interval.
If the context has not been made current at all,
the default value
For a valid context w/ an | |
| glClearDepth | back to summary |
|---|---|
| public void glClearDepth(double depth) Aliased entrypoint of | |
| glDepthRange | back to summary |
|---|---|
| public void glDepthRange(double zNear, double zFar) Aliased entrypoint of | |
| hasBasicFBOSupport | back to summary |
|---|---|
| public boolean hasBasicFBOSupport() Returns
Basic FBO is supported if the context is either GL-ES >= 2.0, GL >= 3.0 [core, compat] or implements the extensions
Basic FBO support may only include one color attachment and no multisampling, as well as limited internal formats for renderbuffer.
| |
| hasFullFBOSupport | back to summary |
|---|---|
| public boolean hasFullFBOSupport() Returns
Full FBO is supported if the context is either GL >= core 3.0 [ES, core, compat] or implements the extensions
Full FBO support includes multiple color attachments and multisampling.
| |
| hasGLSL | back to summary |
|---|---|
| public boolean hasGLSL() Indicates whether this GL object supports GLSL.
| |
| isExtensionAvailable | back to summary |
|---|---|
| public boolean isExtensionAvailable(String glExtensionName) Returns true if the specified OpenGL extension can be used successfully through this GL instance given the current host (OpenGL client) and display (OpenGL server) configuration.
| |
| isFunctionAvailable | back to summary |
|---|---|
| public boolean isFunctionAvailable(String glFunctionName) Returns true if the specified OpenGL core- or extension-function can be used successfully through this GL instance given the current host (OpenGL client) and display (OpenGL server) configuration. By "successfully" we mean that the function is both callable on the machine running the program and available on the current display. In order to call a function successfully, the function must be both callable on the machine running the program and available on the display device that is rendering the output (note: on non-networked, single-display machines these two conditions are identical; on networked and/or multi-display machines this becomes more complicated). These conditions are met if the function is either part of the core OpenGL version supported by both the host and display, or it is an OpenGL extension function that both the host and display support. A GL function is callable if it is successfully linked at runtime, hence the GLContext must be made current at least once.
| |
| isGL | back to summary |
|---|---|
| public boolean isGL() Indicates whether this GL object conforms to any of the OpenGL profiles. | |
| isGL2 | back to summary |
|---|---|
| public boolean isGL2() Indicates whether this GL object conforms to the OpenGL ≤ 3.0 profile. The GL2 profile includes the GL2ES1 and GL2ES2 profile.
| |
| isGL2ES1 | back to summary |
|---|---|
| public boolean isGL2ES1() Indicates whether this GL object conforms to a GL2ES1 compatible profile.
| |
| isGL2ES2 | back to summary |
|---|---|
| public boolean isGL2ES2() Indicates whether this GL object conforms to a GL2ES2 compatible profile.
| |
| isGL2ES3 | back to summary |
|---|---|
| public boolean isGL2ES3() Indicates whether this GL object conforms to a either a GL2GL3 or GL3ES3 compatible profile.
| |
| isGL2GL3 | back to summary |
|---|---|
| public boolean isGL2GL3() Indicates whether this GL object conforms to a GL2GL3 compatible profile.
| |
| isGL3 | back to summary |
|---|---|
| public boolean isGL3() Indicates whether this GL object conforms to the OpenGL ≥ 3.1 core profile. The GL3 core profile includes the GL2ES2 profile.
| |
| isGL3bc | back to summary |
|---|---|
| public boolean isGL3bc() Indicates whether this GL object conforms to the OpenGL ≥ 3.1 compatibility profile. The GL3 compatibility profile includes the GL2, GL2ES1, GL2ES2 and GL3 profile.
| |
| isGL3core | back to summary |
|---|---|
| public boolean isGL3core() Indicates whether this GL object uses a GL3 core profile. Includes [ GL4, GL3 ].
| |
| isGL3ES3 | back to summary |
|---|---|
| public boolean isGL3ES3() Indicates whether this GL object conforms to a GL3ES3 compatible profile.
| |
| isGL4 | back to summary |
|---|---|
| public boolean isGL4() Indicates whether this GL object conforms to the OpenGL ≥ 4.0 core profile. The GL4 core profile includes the GL2ES2, and GL3 profile.
| |
| isGL4bc | back to summary |
|---|---|
| public boolean isGL4bc() Indicates whether this GL object conforms to the OpenGL ≥ 4.0 compatibility profile. The GL4 compatibility profile includes the GL2, GL2ES1, GL2ES2, GL3, GL3bc and GL4 profile.
| |
| isGL4core | back to summary |
|---|---|
| public boolean isGL4core() Indicates whether this GL object uses a GL4 core profile. Includes [ GL4 ].
| |
| isGL4ES3 | back to summary |
|---|---|
| public boolean isGL4ES3() Returns true if this GL object conforms to a GL4ES3 compatible profile, i.e. if Includes [ GL ≥ 4.3, GL ≥ 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]
| |
| isGLcore | back to summary |
|---|---|
| public boolean isGLcore() Indicates whether this GL object uses a GL core profile. Includes [ GL4, GL3, GLES3, GL2ES2 ].
| |
| isGLES | back to summary |
|---|---|
| public boolean isGLES() Indicates whether this GL object conforms to one of the OpenGL ES profiles,
see
| |
| isGLES1 | back to summary |
|---|---|
| public boolean isGLES1() Indicates whether this GL object conforms to the OpenGL ES ≥ 1.0 profile.
| |
| isGLES2 | back to summary |
|---|---|
| public boolean isGLES2() Indicates whether this GL object conforms to the OpenGL ES ≥ 2.0 profile.
Remark: ES2 compatible desktop profiles are not included.
To query whether core ES2 functionality is provided, use
| |
| isGLES2Compatible | back to summary |
|---|---|
| public boolean isGLES2Compatible() Indicates whether this GL object is compatible with the core OpenGL ES2 functionality.
| |
| isGLES3 | back to summary |
|---|---|
| public boolean isGLES3() Indicates whether this GL object conforms to the OpenGL ES ≥ 3.0 profile.
Remark: ES3 compatible desktop profiles are not included.
To query whether core ES3 functionality is provided, use
| |
| isGLES31Compatible | back to summary |
|---|---|
| public boolean isGLES31Compatible() Indicates whether this GL object is compatible with the core OpenGL ES3.1 functionality.
Return true if the underlying context is an ES3 context ≥ 3.1 or implements
the extension Includes [ GL ≥ 4.5, GL ≥ 3.1 w/ GL_ARB_ES3_1_compatibility and GLES3 ≥ 3.1 ]
| |
| isGLES32Compatible | back to summary |
|---|---|
| public boolean isGLES32Compatible() Indicates whether this GL object is compatible with the core OpenGL ES3.2 functionality.
Return true if the underlying context is an ES3 context ≥ 3.2 or implements
the extension Includes [ GL ≥ 4.5, GL ≥ 3.1 w/ GL_ARB_ES3_2_compatibility and GLES3 ≥ 3.2 ]
| |
| isGLES3Compatible | back to summary |
|---|---|
| public boolean isGLES3Compatible() Indicates whether this GL object is compatible with the core OpenGL ES3 functionality.
Return true if the underlying context is an ES3 context or implements
the extension Includes [ GL ≥ 4.3, GL ≥ 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]
| |
| isNPOTTextureAvailable | back to summary |
|---|---|
| public boolean isNPOTTextureAvailable() Returns true if the GL context supports non power of two (NPOT) textures, otherwise false. NPOT textures are supported in OpenGL >= 3, GLES2 or if the 'GL_ARB_texture_non_power_of_two' extension is available. | |
| isTextureFormatBGRA8888Available | back to summary |
|---|---|
| public boolean isTextureFormatBGRA8888Available() | |
| isVBOArrayBound | back to summary |
|---|---|
public boolean isVBOArrayBound()
| |
| isVBOElementArrayBound | back to summary |
|---|---|
public boolean isVBOElementArrayBound()
| |
| mapBuffer | back to summary |
|---|---|
| public GLBufferStorage mapBuffer(int target, int access) throws GLException Returns the
Throws a
A zero
A null native mapping result indicating an error will
not cause a GLException but returns the unmapped
| |
| mapBufferRange | back to summary |
|---|---|
| public GLBufferStorage mapBufferRange(final int target, final long offset, final long length, final int access) throws GLException Returns the
Throws a
A zero
A null native mapping result indicating an error will
not cause a GLException but returns the unmapped
| |
| setSwapInterval | back to summary |
|---|---|
| public void setSwapInterval(int interval) throws GLException Set the swap interval of the current context and attached onscreen
offscreen
The
| |