Package com.luciad.view.lightspeed
Class TLspOpenGLProfile
java.lang.Object
com.luciad.view.lightspeed.TLspOpenGLProfile
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final TLspOpenGLProfileMatchesLIGHTSPEED_MINIMUMplus theGL_ARB_framebuffer_objectextension.static final TLspOpenGLProfileMatches OpenGL versions 4.2 and above. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a newTLspOpenGLProfile.protectedTLspOpenGLProfile(TLspOpenGLProfile aBaseLine) Creates a newTLspOpenGLProfilewith the specified baseline.TLspOpenGLProfile(TLspOpenGLProfile aRequiredBaseLine, int aRequiredMajorVersion, int aRequiredMinorVersion, String[] aRequiredExtensions) Creates a newTLspOpenGLProfilewith the specified baseline, minimum OpenGL version and list of required OpenGL extensions. -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns the extensions of this OpenGL profile as a string arrayintReturns the major version number of this OpenGL profileintReturns the minor version number of this OpenGL profilestatic TLspOpenGLProfilegetSuperSet(TLspOpenGLProfile... aProfiles) Creates a new OpenGL profile which matches a superset of the supplied profiles.booleanisCompatible(ILcdGLDrawable aGLDrawable) Determines whether or not the suppliedILcdGLDrawablemeets all the requirements of this OpenGL profile.static booleanisExtensionAvailable(ILcdGLDrawable aGLDrawable, String aExtension) Determines whether the specified OpenGL extension is supported in the givenILcdGLDrawable.voidsetExtensions(String[] aExtensions) Sets the extensions of this OpenGL profile to the given extensionsvoidsetMajorVersion(int aMajorVersion) Sets the major version number of this OpenGL profile to the given version numbervoidsetMinorVersion(int aMinorVersion) Sets the minor version number of this OpenGL profile to the given version numbertoString()
-
Field Details
-
LIGHTSPEED_MINIMUM
Matches OpenGL versions 4.2 and above. -
FRAMEBUFFER_OBJECT
MatchesLIGHTSPEED_MINIMUMplus theGL_ARB_framebuffer_objectextension.
-
-
Constructor Details
-
TLspOpenGLProfile
public TLspOpenGLProfile(TLspOpenGLProfile aRequiredBaseLine, int aRequiredMajorVersion, int aRequiredMinorVersion, String[] aRequiredExtensions) Creates a newTLspOpenGLProfilewith the specified baseline, minimum OpenGL version and list of required OpenGL extensions.- Parameters:
aRequiredBaseLine- base lineaRequiredMajorVersion- major OpenGL version numberaRequiredMinorVersion- minor OpenGL version numberaRequiredExtensions- list of required extensions
-
TLspOpenGLProfile
protected TLspOpenGLProfile()Creates a newTLspOpenGLProfile. No baseline profile is set.- See Also:
-
TLspOpenGLProfile
Creates a newTLspOpenGLProfilewith the specified baseline. If the baseline profile is notnull,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
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
Sets the extensions of this OpenGL profile to the given extensions- Parameters:
aExtensions- the new set of extensions for this OpenGL profile
-
getSuperSet
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 ofaProfiles.- Parameters:
aProfiles- array of profiles to group- Returns:
- a profile that encompasses all the input profiles
-
isCompatible
Determines whether or not the suppliedILcdGLDrawablemeets 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- theILcdGLDrawablein which to check for compatibility- Returns:
- true if this profile is supported by the given drawable
-
isExtensionAvailable
Determines whether the specified OpenGL extension is supported in the givenILcdGLDrawable.- Parameters:
aGLDrawable- theILcdGLDrawablein which to check for availability of the extensionaExtension- the extension to check for- Returns:
- true if the extension is available
-
toString
-