Class TLspOpenGLProfile

java.lang.Object
com.luciad.view.lightspeed.TLspOpenGLProfile

public class TLspOpenGLProfile extends Object
Provides a mechanism to classify the level of OpenGL support on an end-user system. A profile can be tested for compatibility with a given ILcdGLDrawable using the isCompatible(com.luciad.view.opengl.binding.ILcdGLDrawable) isCompatible} method. The profile could check, for instance, for certain OpenGL versions or for the availability of certain OpenGL extensions. A few commonly used profiles are defined as constants in this class; other, more specific profiles can be created by extending this class. Each ILspPainter must advertise the profile it minimally requires via its getRequiredOpenGLProfile method.
Since:
2012.0
  • Field Details

    • LIGHTSPEED_MINIMUM

      public static final TLspOpenGLProfile LIGHTSPEED_MINIMUM
      Matches OpenGL versions 4.2 and above.
    • FRAMEBUFFER_OBJECT

      public static final TLspOpenGLProfile FRAMEBUFFER_OBJECT
      Matches LIGHTSPEED_MINIMUM plus the GL_ARB_framebuffer_object extension.
  • Constructor Details

    • TLspOpenGLProfile

      public TLspOpenGLProfile(TLspOpenGLProfile aRequiredBaseLine, int aRequiredMajorVersion, int aRequiredMinorVersion, String[] aRequiredExtensions)
      Creates a new TLspOpenGLProfile with the specified baseline, minimum OpenGL version and list of required OpenGL extensions.
      Parameters:
      aRequiredBaseLine - base line
      aRequiredMajorVersion - major OpenGL version number
      aRequiredMinorVersion - minor OpenGL version number
      aRequiredExtensions - list of required extensions
    • TLspOpenGLProfile

      protected TLspOpenGLProfile()
      Creates a new TLspOpenGLProfile. No baseline profile is set.
      See Also:
    • TLspOpenGLProfile

      protected TLspOpenGLProfile(TLspOpenGLProfile aBaseLine)
      Creates a new TLspOpenGLProfile with the specified baseline. If the baseline profile is not null, isCompatible(com.luciad.view.opengl.binding.ILcdGLDrawable) will delegate to the baseline.
      Parameters:
      aBaseLine - the base line profile
  • Method Details

    • getMajorVersion

      public int getMajorVersion()
      Returns the major version number of this OpenGL profile
      Returns:
      the major version number of this OpenGL profile
    • setMajorVersion

      public void setMajorVersion(int aMajorVersion)
      Sets the major version number of this OpenGL profile to the given version number
      Parameters:
      aMajorVersion - the new major version number for this OpenGL profile
    • getMinorVersion

      public int getMinorVersion()
      Returns the minor version number of this OpenGL profile
      Returns:
      the minor version number of this OpenGL profile
    • setMinorVersion

      public void setMinorVersion(int aMinorVersion)
      Sets the minor version number of this OpenGL profile to the given version number
      Parameters:
      aMinorVersion - the new minor version number for this OpenGL profile
    • getExtensions

      public String[] getExtensions()
      Returns the extensions of this OpenGL profile as a string array
      Returns:
      the extensions of this OpenGL profile as a string array or null
    • setExtensions

      public void setExtensions(String[] aExtensions)
      Sets the extensions of this OpenGL profile to the given extensions
      Parameters:
      aExtensions - the new set of extensions for this OpenGL profile
    • getSuperSet

      public static TLspOpenGLProfile getSuperSet(TLspOpenGLProfile... aProfiles)
      Creates a new OpenGL profile which matches a superset of the supplied profiles. In other words, the resulting profile is only compatible with views which are compatible with all elements of aProfiles.
      Parameters:
      aProfiles - array of profiles to group
      Returns:
      a profile that encompasses all the input profiles
    • isCompatible

      public boolean isCompatible(ILcdGLDrawable aGLDrawable)
      Determines whether or not the supplied ILcdGLDrawable meets all the requirements of this OpenGL profile. If this method returns false, a painter which requires this profile will not work with the given drawable. This method may check for specific OpenGL versions, for the availability of certain OpenGL extensions, or for any other implementation-specific variable that a painter might depend on (e.g. maximum texture resolution, matrix stack depths, ...).
      Parameters:
      aGLDrawable - the ILcdGLDrawable in which to check for compatibility
      Returns:
      true if this profile is supported by the given drawable
    • isExtensionAvailable

      public static boolean isExtensionAvailable(ILcdGLDrawable aGLDrawable, String aExtension)
      Determines whether the specified OpenGL extension is supported in the given ILcdGLDrawable.
      Parameters:
      aGLDrawable - the ILcdGLDrawable in which to check for availability of the extension
      aExtension - the extension to check for
      Returns:
      true if the extension is available
    • toString

      public String toString()
      Overrides:
      toString in class Object