|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GLBase
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(java.lang.String)
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(java.lang.String)
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:
wglAllocateMemoryNV
/
glXAllocateMemoryNV
and associated routines. #glAllocateMemoryNV
has been provided for window system-independent
access to VAR. isFunctionAvailable(java.lang.String)
will translate an argument
of "glAllocateMemoryNV" or "glFreeMemoryNV" into the appropriate
window system-specific name.
isExtensionAvailable(java.lang.String)
with an argument of
"GL_ARB_pbuffer" or "GL_ARB_pixel_format".
Method Summary | |
---|---|
GLContext |
getContext()
Returns the GLContext with which this GL object is associated. |
Object |
getExtension(String extensionName)
Returns an object providing access to the specified OpenGL extension. |
GL |
getGL()
Casts this object to the GL interface. |
GL2 |
getGL2()
Casts this object to the GL2 interface. |
GL2ES1 |
getGL2ES1()
Casts this object to the GL2ES1 interface. |
GL2ES2 |
getGL2ES2()
Casts this object to the GL2ES2 interface. |
GL2GL3 |
getGL2GL3()
Casts this object to the GL2GL3 interface. |
GL3 |
getGL3()
Casts this object to the GL3 interface. |
GLES1 |
getGLES1()
Casts this object to the GLES1 interface. |
GLES2 |
getGLES2()
Casts this object to the GLES2 interface. |
GLProfile |
getGLProfile()
Returns the GLProfile with which this GL object is associated. |
Object |
getPlatformGLExtensions()
Returns an object through which platform-specific OpenGL extensions (EGL, GLX, WGL, etc.) may be accessed. |
int |
getSwapInterval()
Provides a platform-independent way to get the swap interval set by setSwapInterval(int) . |
boolean |
hasGLSL()
Indicates whether this GL object supports GLSL. |
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. |
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. |
boolean |
isGL()
Indicates whether this GL object conforms to any of the common GL profiles. |
boolean |
isGL2()
Indicates whether this GL object conforms to the GL2 profile. |
boolean |
isGL2ES1()
Indicates whether this GL object conforms to the GL2ES1 compatible profile. |
boolean |
isGL2ES2()
Indicates whether this GL object conforms to the GL2ES2 compatible profile. |
boolean |
isGL2GL3()
Indicates whether this GL object conforms to the GL2GL3 compatible profile. |
boolean |
isGL3()
Indicates whether this GL object conforms to the GL3 profile. |
boolean |
isGLES()
Indicates whether this GL object conforms to one of the OpenGL ES compatible profiles. |
boolean |
isGLES1()
Indicates whether this GL object conforms to the GLES1 profile. |
boolean |
isGLES2()
Indicates whether this GL object conforms to the GLES2 profile. |
void |
setSwapInterval(int interval)
Provides a platform-independent way to specify the minimum swap interval for buffer swaps. |
Method Detail |
---|
boolean isGL()
boolean isGL3()
boolean isGL2()
boolean isGLES1()
boolean isGLES2()
boolean isGLES()
boolean isGL2ES1()
boolean isGL2ES2()
boolean isGL2GL3()
boolean hasGLSL()
GL getGL() throws GLException
GLException
- if this GLObject is not a GL implementationGL3 getGL3() throws GLException
GLException
- if this GLObject is not a GL3 implementationGL2 getGL2() throws GLException
GLException
- if this GLObject is not a GL2 implementationGLES1 getGLES1() throws GLException
GLException
- if this GLObject is not a GLES1 implementationGLES2 getGLES2() throws GLException
GLException
- if this GLObject is not a GLES2 implementationGL2ES1 getGL2ES1() throws GLException
GLException
- if this GLObject is not a GL2ES1 implementationGL2ES2 getGL2ES2() throws GLException
GLException
- if this GLObject is not a GL2ES2 implementationGL2GL3 getGL2GL3() throws GLException
GLException
- if this GLObject is not a GL2GL3 implementationGLProfile getGLProfile()
GLContext getContext()
boolean isFunctionAvailable(String glFunctionName)
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.
glFunctionName
- the name of the OpenGL function (e.g., use
"glBindRenderbufferEXT" or "glBindRenderbuffer" to check if #glBindRenderbuffer(int,int)
is available).boolean isExtensionAvailable(String glExtensionName)
glExtensionName
- the name of the OpenGL extension (e.g.,
"GL_ARB_vertex_program").void setSwapInterval(int interval)
GLException
- if this context is not the currentgetSwapInterval()
int getSwapInterval()
setSwapInterval(int)
. setSwapInterval(int)
yet,
-1 is returned, indicating that the platforms default
is being used.
setSwapInterval(int)
Object getPlatformGLExtensions()
Object getExtension(String extensionName)
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |