NASA World Wind

gov.nasa.worldwind.util
Class BasicGLCapabilitiesChooser

java.lang.Object
  extended by javax.media.opengl.DefaultGLCapabilitiesChooser
      extended by gov.nasa.worldwind.util.BasicGLCapabilitiesChooser
All Implemented Interfaces:
CapabilitiesChooser, GLCapabilitiesChooser

public class BasicGLCapabilitiesChooser
extends DefaultGLCapabilitiesChooser

BasicGLCapabilitiesChooser provides an implementation of GLCapabilitiesChooser for use with WorldWindow implementations (for example, WorldWindowGLCanvas and WorldWindowGLJPanel).

BasicGLCapabilitiesChooser extends the behavior of the default GLCapabilitiesChooser by implementing a fallback behavior when device supported stereo is requested but is not supported by the hardware. In this case, BasicGLCapabilitiesChooser attempts to find a match to the desired capabilities, but without device supported stereo. When the application does not request device supported stereo, BasicGLCapabilitiesChooser provides the same behavior as DefaultGLCapabilitiesChooser.


Constructor Summary
BasicGLCapabilitiesChooser()
          Constructs a new BasicGLCapabilitiesChooser, but otherwise does nothing.
 
Method Summary
 int chooseCapabilities(CapabilitiesImmutable desired, List<? extends CapabilitiesImmutable> available, int windowSystemRecommendedChoice)
          Overridden to provide a fallback behavior when device supported stereo requested but is not supported by the hardware.
protected  int chooseStereoCapabilities(CapabilitiesImmutable desired, List<? extends CapabilitiesImmutable> available, int windowSystemRecommendedChoice)
          Attempts to use the superclass functionality to find a match to the desired GL capabilities in the list of available capabilities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicGLCapabilitiesChooser

public BasicGLCapabilitiesChooser()
Constructs a new BasicGLCapabilitiesChooser, but otherwise does nothing.

Method Detail

chooseCapabilities

public int chooseCapabilities(CapabilitiesImmutable desired,
                              List<? extends CapabilitiesImmutable> available,
                              int windowSystemRecommendedChoice)
Overridden to provide a fallback behavior when device supported stereo requested but is not supported by the hardware. When the desired GL capabilities does not specify device supported stereo, this calls DefaultGLCapabilitiesChooser.chooseCapabilities.

Specified by:
chooseCapabilities in interface CapabilitiesChooser
Overrides:
chooseCapabilities in class DefaultGLCapabilitiesChooser
Parameters:
desired - the desired GL capabilities.
available - the list of available GL capabilities on the graphics device.
windowSystemRecommendedChoice - an index into the list of available GL capabilities indicating the window system's recommended capabilities, or -1 to indicate no recommendation.
Returns:
an index into the list of available GL capabilities.

chooseStereoCapabilities

protected int chooseStereoCapabilities(CapabilitiesImmutable desired,
                                       List<? extends CapabilitiesImmutable> available,
                                       int windowSystemRecommendedChoice)
Attempts to use the superclass functionality to find a match to the desired GL capabilities in the list of available capabilities. This assumes that the desired GL capabilities request device supported stereo. If the superclass cannot find a match, this attempts to find a match to the desired capabilities, but without device supported stereo.

Parameters:
desired - the desired GL capabilities.
available - the list of available GL capabilities on the graphics device.
windowSystemRecommendedChoice - an index into the list of available GL capabilities indicating the window system's recommended capabilities, or -1 to indicate no recommendation.
Returns:
an index into the list of available GL capabilities.

NASA World Wind