public class GLRuntimeCapabilities
extends java.lang.Object
is[Feature]Available
defines whether or not the feature is supported by the current GL runtime.
This is an attribute of the GL runtime, and is typically configured automatically by a call to initialize(javax.media.opengl.GLContext)
.is[Feature]Enabled
defines whether or
not this feature should be used, and must be configured by the caller. isUse[Feature]()
. This returns whether or not the feature is available and is enabled for use (it is
simply a conjunction of the "available" and "enabled" properties).initialize(javax.media.opengl.GLContext)
with a valid GLContext at the beginning
of each rendering pass.Modifier and Type | Field and Description |
---|---|
protected int |
depthBits |
protected static java.lang.String |
GL_EXT_FRAMEBUFFER_OBJECT_STRING |
protected static java.lang.String |
GL_EXT_TEXTURE_FILTER_ANISOTROPIC_STRING |
protected double |
glVersion |
protected boolean |
isAnisotropicTextureFilterAvailable |
protected boolean |
isAnisotropicTextureFilterEnabled |
protected boolean |
isFramebufferObjectAvailable |
protected boolean |
isFramebufferObjectEnabled |
protected boolean |
isVertexBufferObjectAvailable |
protected boolean |
isVertexBufferObjectEnabled |
protected boolean |
isVMwareSVGA3D |
protected double |
maxTextureAnisotropy |
protected int |
maxTextureSize |
protected int |
numTextureUnits |
Constructor and Description |
---|
GLRuntimeCapabilities()
Constructs a new GLAtttributes, enabling framebuffer objects, anisotropic texture filtering, and vertex buffer
objects.
|
Modifier and Type | Method and Description |
---|---|
int |
getDepthBits()
Returns the number of bitplanes in the current GL depth buffer.
|
double |
getGLVersion()
Returns the current GL runtime version as a real number.
|
double |
getMaxTextureAnisotropy()
Returns a real number defining the maximum degree of texture anisotropy supported by the current GL runtime.
|
int |
getMaxTextureSize()
Returns the maximum texture size in texels supported by the current GL runtime.
|
int |
getNumTextureUnits()
Returns the number of texture units supported by the current GL runtime.
|
void |
initialize(GLContext glContext)
Initialize this GLRuntimeCapabilities from the specified
GLContext . |
boolean |
isAnisotropicTextureFilterAvailable()
Returns true if anisotropic filtering is available in the current GL runtime.
|
boolean |
isAnisotropicTextureFilterEnabled()
Returns true if anisotropic texture filtering is enabled for use (only applicable if the feature is available in
the current GL runtime)
|
boolean |
isFramebufferObjectAvailable()
Returns true if framebuffer objects are available in the current GL runtime.
|
boolean |
isFramebufferObjectEnabled()
Returns true if framebuffer objects are enabled for use (only applicable if the feature is available in the
current GL runtime)
|
boolean |
isUseAnisotropicTextureFilter()
Returns true if anisotropic texture filtering is available in the current GL runtime, and is enabled.
|
boolean |
isUseFramebufferObject()
Returns true if framebuffer objects are available in the current GL runtime, and are enabled.
|
boolean |
isUseVertexBufferObject()
Returns true if vertex buffer objects are available in the current GL runtime, and are enabled.
|
boolean |
isVertexBufferObjectAvailable()
Returns true if vertex buffer objects are available in the current GL runtime.
|
boolean |
isVertexBufferObjectEnabled()
Returns true if anisotropic vertex buffer objects are enabled for use (only applicable if the feature is
available in the current GL runtime).
|
boolean |
isVMwareSVGA3D()
Returns true if the OpenGL implementation is provided by the VMware SVGA 3D driver.
|
void |
setAnisotropicTextureFilterAvailable(boolean available)
Sets whether or not anisotropic filtering is available in the current GL runtime.
|
void |
setAnisotropicTextureFilterEnabled(boolean enable)
Sets whether or not anisotropic texture filtering should be used if it is available in the current GL runtime.
|
void |
setDepthBits(int depthBits)
Sets the number of bitplanes in the current GL depth buffer.
|
void |
setFramebufferObjectAvailable(boolean available)
Sets whether or not framebuffer objects are available in the current GL runtime.
|
void |
setFramebufferObjectEnabled(boolean enable)
Sets whether or not framebuffer objects should be used if they are available in the current GL runtime.
|
void |
setGLVersion(double version)
Sets the current GL runtime version as a real number.
|
void |
setMaxTextureAnisotropy(double maxAnisotropy)
Sets the maximum degree of texture anisotropy supported by the current GL runtime.
|
void |
setMaxTextureSize(int maxTextureSize)
Sets the maximum texture size in texels supported by the current GL runtime.
|
void |
setNumTextureUnits(int numTextureUnits)
Sets the number of texture units supported by the current GL runtime.
|
void |
setVertexBufferObjectAvailable(boolean available)
Sets whether or not vertext buffer objects are available in the current GL runtime.
|
void |
setVertexBufferObjectEnabled(boolean enable)
Sets whether or not vertex buffer objects should be used if they are available in the current GL runtime.
|
protected int depthBits
protected static final java.lang.String GL_EXT_FRAMEBUFFER_OBJECT_STRING
protected static final java.lang.String GL_EXT_TEXTURE_FILTER_ANISOTROPIC_STRING
protected double glVersion
protected boolean isAnisotropicTextureFilterAvailable
protected boolean isAnisotropicTextureFilterEnabled
protected boolean isFramebufferObjectAvailable
protected boolean isFramebufferObjectEnabled
protected boolean isVertexBufferObjectAvailable
protected boolean isVertexBufferObjectEnabled
protected boolean isVMwareSVGA3D
protected double maxTextureAnisotropy
protected int maxTextureSize
protected int numTextureUnits
public GLRuntimeCapabilities()
initialize(javax.media.opengl.GLContext)
.
Note: The default vertex-buffer usage flag can be set via Configuration
using the key
"gov.nasa.worldwind.avkey.VBOUsage". If that key is not specified in the configuration then vertex-buffer usage
defaults to true
.public int getDepthBits()
public double getGLVersion()
public double getMaxTextureAnisotropy()
public int getMaxTextureSize()
public int getNumTextureUnits()
public void initialize(GLContext glContext)
GLContext
. The context's
runtime GL capabilities are examined, and the properties of this GLRuntimeCapabilities are modified accordingly.
Invoking initialize() may change any property of this GLRuntimeCapabilities, except the caller specified enable
flags: is[Feature]Enabled.glContext
- the GLContext from which to initialize GL runtime capabilities.java.lang.IllegalArgumentException
- if the glContext is null.public boolean isAnisotropicTextureFilterAvailable()
public boolean isAnisotropicTextureFilterEnabled()
public boolean isFramebufferObjectAvailable()
public boolean isFramebufferObjectEnabled()
public boolean isUseAnisotropicTextureFilter()
public boolean isUseFramebufferObject()
public boolean isUseVertexBufferObject()
public boolean isVertexBufferObjectAvailable()
public boolean isVertexBufferObjectEnabled()
public boolean isVMwareSVGA3D()
public void setAnisotropicTextureFilterAvailable(boolean available)
available
- true to flag anisotropic texture filtering as available, and false otherwise.public void setAnisotropicTextureFilterEnabled(boolean enable)
enable
- true to enable anisotropic texture filtering, false to disable it.public void setDepthBits(int depthBits)
depthBits
- the number of bitplanes in the current GL depth buffer.java.lang.IllegalArgumentException
- if depthBits is less than one.public void setFramebufferObjectAvailable(boolean available)
available
- true to flag framebuffer objects as available, and false otherwise.public void setFramebufferObjectEnabled(boolean enable)
enable
- true to enable framebuffer objects, false to disable them.public void setGLVersion(double version)
version
- the GL version as a number.public void setMaxTextureAnisotropy(double maxAnisotropy)
maxAnisotropy
- the maximum degree of texture anisotropy supported.public void setMaxTextureSize(int maxTextureSize)
maxTextureSize
- the maximum texture size supported, in texels.java.lang.IllegalArgumentException
- if the size is less than one.public void setNumTextureUnits(int numTextureUnits)
numTextureUnits
- the number texture units supported.java.lang.IllegalArgumentException
- if the number of texture units is less than one.public void setVertexBufferObjectAvailable(boolean available)
available
- true to flag vertex buffer objects as available, and false otherwise.public void setVertexBufferObjectEnabled(boolean enable)
enable
- true to enable vertex buffer objects, false to disable them.