Class BasicGLCapabilitiesChooser

  • All Implemented Interfaces:
    com.jogamp.nativewindow.CapabilitiesChooser, com.jogamp.opengl.GLCapabilitiesChooser

    public class BasicGLCapabilitiesChooser
    extends com.jogamp.opengl.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

      Constructors 
      Constructor Description
      BasicGLCapabilitiesChooser()
      Constructs a new BasicGLCapabilitiesChooser, but otherwise does nothing.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int chooseCapabilities​(com.jogamp.nativewindow.CapabilitiesImmutable desired, java.util.List<? extends com.jogamp.nativewindow.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​(com.jogamp.nativewindow.CapabilitiesImmutable desired, java.util.List<? extends com.jogamp.nativewindow.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, 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​(com.jogamp.nativewindow.CapabilitiesImmutable desired,
                                      java.util.List<? extends com.jogamp.nativewindow.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 com.jogamp.nativewindow.CapabilitiesChooser
        Overrides:
        chooseCapabilities in class com.jogamp.opengl.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​(com.jogamp.nativewindow.CapabilitiesImmutable desired,
                                               java.util.List<? extends com.jogamp.nativewindow.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.