Package com.jogamp.opengl
Class GLCapabilities
java.lang.Object
com.jogamp.nativewindow.Capabilities
com.jogamp.opengl.GLCapabilities
- All Implemented Interfaces:
com.jogamp.common.type.WriteCloneable,CapabilitiesImmutable,VisualIDHolder,GLCapabilitiesImmutable,Cloneable,Comparable<CapabilitiesImmutable>
Specifies a set of OpenGL capabilities.
At creation time of a
The actual capabilites of created
It currently contains the minimal number of routines which allow configuration on all supported window systems.
At creation time of a
GLDrawable using GLDrawableFactory,
an instance of this class is passed,
describing the desired capabilities that a rendering context
must support, such as the OpenGL profile, color depth and whether stereo is enabled.The actual capabilites of created
GLDrawables are then reflected by their own
GLCapabilites instance, which can be queried with GLDrawable.getChosenGLCapabilities().
It currently contains the minimal number of routines which allow configuration on all supported window systems.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jogamp.nativewindow.VisualIDHolder
VisualIDHolder.VIDComparator, VisualIDHolder.VIDType -
Field Summary
Fields inherited from interface com.jogamp.opengl.GLCapabilitiesImmutable
DEFAULT_SAMPLE_EXTENSIONFields inherited from interface com.jogamp.nativewindow.VisualIDHolder
VID_UNDEFINED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()intcomparing hw/sw, stereo, multisample, stencil, RGBA and depth onlycopyFrom(GLCapabilitiesImmutable source) Copies allGLCapabilitiesImmutablevalues fromsourceinto this instance.booleanEquality over the immutable attributes of both objectsfinal intReturns the number of bits for the accumulation buffer's alpha component.final intReturns the number of bits for the accumulation buffer's blue component.final intReturns the number of bits for the accumulation buffer's green component.final intReturns the number of bits for the accumulation buffer's red component.final intReturns the number of depth buffer bits.final booleanReturns whether double-buffering is requested, available or chosen.final GLProfileReturns the GL profile you desire or used by the drawable.final booleanReturns whether hardware acceleration is requested, available or chosen.final intReturns the number of sample buffers to be allocated if sample buffers are enabled, otherwise returns 0.final booleanReturns whether sample buffers for full-scene antialiasing (FSAA) should be allocated for this drawable.final StringReturns the extension for full-scene antialiasing (FSAA).final intReturns the number of stencil buffer bits.final booleanReturns whether stereo is requested, available or chosen.inthashCode()hash code over the immutable attributes of both objectsfinal booleanisFBO()Returns whether FBO offscreen mode is requested, available or chosen.final booleanReturns whether pbuffer offscreen mode is requested, available or chosen.voidsetAccumAlphaBits(int accumAlphaBits) Sets number of bits requested for accumulation buffer's alpha component.voidsetAccumBlueBits(int accumBlueBits) Sets the number of bits requested for the accumulation buffer's blue component.voidsetAccumGreenBits(int accumGreenBits) Sets the number of bits requested for the accumulation buffer's green component.voidsetAccumRedBits(int accumRedBits) Sets the number of bits requested for the accumulation buffer's red component.voidsetDepthBits(int depthBits) Sets the number of bits requested for the depth buffer.voidsetDoubleBuffered(boolean enable) Enables or disables double buffering.voidsetFBO(boolean enable) Requesting offscreen FBO mode.voidsetGLProfile(GLProfile profile) Sets the GL profile you desirevoidsetHardwareAccelerated(boolean enable) Enables or disables hardware acceleration.voidsetNumSamples(int numSamples) If sample buffers are enabled, indicates the number of buffers to be allocated.voidsetPBuffer(boolean enable) Requesting offscreen pbuffer mode.voidsetSampleBuffers(boolean enable) Defaults to false.
Indicates whether sample buffers for full-scene antialiasing (FSAA) should be allocated for this drawable.
Mind that this requires the alpha component.
If enabled this method also invokessetAlphaBits(1)ifCapabilities.getAlphaBits()== 0.voidSets the desired extension for full-scene antialiasing (FSAA), default isGLCapabilitiesImmutable.DEFAULT_SAMPLE_EXTENSION.voidsetStencilBits(int stencilBits) Sets the number of bits requested for the stencil buffer.voidsetStereo(boolean enable) Enables or disables stereo viewing.toString()Returns a textual representation of this GLCapabilities object.toString(StringBuilder sink) Return a textual representation of this object.Methods inherited from class com.jogamp.nativewindow.Capabilities
copyFrom, getAlphaBits, getBlueBits, getGreenBits, getRedBits, getTransparentAlphaValue, getTransparentBlueValue, getTransparentGreenValue, getTransparentRedValue, getVisualID, isBackgroundOpaque, isBitmap, isOnscreen, setAlphaBits, setBackgroundOpaque, setBitmap, setBlueBits, setGreenBits, setOnscreen, setRedBits, setTransparentAlphaValue, setTransparentBlueValue, setTransparentGreenValue, setTransparentRedValueMethods inherited from interface com.jogamp.nativewindow.CapabilitiesImmutable
getAlphaBits, getBlueBits, getGreenBits, getRedBits, getTransparentAlphaValue, getTransparentBlueValue, getTransparentGreenValue, getTransparentRedValue, isBackgroundOpaque, isBitmap, isOnscreenMethods inherited from interface com.jogamp.nativewindow.VisualIDHolder
getVisualID
-
Constructor Details
-
GLCapabilities
Creates a GLCapabilities object. All attributes are in a default state.- Parameters:
glp- GLProfile, or null for the default GLProfile- Throws:
GLException- if no profile is given and no default profile is available for the default device.
-
-
Method Details
-
cloneMutable
- Specified by:
cloneMutablein interfacecom.jogamp.common.type.WriteCloneable- Overrides:
cloneMutablein classCapabilities
-
clone
- Overrides:
clonein classCapabilities
-
copyFrom
Copies allGLCapabilitiesImmutablevalues fromsourceinto this instance.- Returns:
- this instance
-
hashCode
public int hashCode()Description copied from interface:com.jogamp.nativewindow.CapabilitiesImmutablehash code over the immutable attributes of both objects- Specified by:
hashCodein interfaceCapabilitiesImmutable- Specified by:
hashCodein interfaceGLCapabilitiesImmutable- Overrides:
hashCodein classCapabilities
-
equals
Description copied from interface:com.jogamp.nativewindow.CapabilitiesImmutableEquality over the immutable attributes of both objects- Specified by:
equalsin interfaceCapabilitiesImmutable- Specified by:
equalsin interfaceGLCapabilitiesImmutable- Overrides:
equalsin classCapabilities
-
compareTo
comparing hw/sw, stereo, multisample, stencil, RGBA and depth only- Specified by:
compareToin interfaceComparable<CapabilitiesImmutable>- Overrides:
compareToin classCapabilities
-
getGLProfile
Description copied from interface:GLCapabilitiesImmutableReturns the GL profile you desire or used by the drawable.- Specified by:
getGLProfilein interfaceGLCapabilitiesImmutable
-
setGLProfile
Sets the GL profile you desire -
isPBuffer
public final boolean isPBuffer()Description copied from interface:GLCapabilitiesImmutableReturns whether pbuffer offscreen mode is requested, available or chosen.Default is false.
For chosen capabilities, only the selected offscreen surface is set to
true.- Specified by:
isPBufferin interfaceGLCapabilitiesImmutable
-
setPBuffer
public void setPBuffer(boolean enable) Requesting offscreen pbuffer mode.If enabled this method also invokes
setOnscreen(false).Defaults to false.
Requesting offscreen pbuffer mode disables the offscreen auto selection.
-
isFBO
public final boolean isFBO()Description copied from interface:GLCapabilitiesImmutableReturns whether FBO offscreen mode is requested, available or chosen.Default is false.
For chosen capabilities, only the selected offscreen surface is set to
true.- Specified by:
isFBOin interfaceGLCapabilitiesImmutable
-
setFBO
public void setFBO(boolean enable) Requesting offscreen FBO mode.If enabled this method also invokes
setOnscreen(false).Defaults to false.
Requesting offscreen FBO mode disables the offscreen auto selection.
-
getDoubleBuffered
public final boolean getDoubleBuffered()Description copied from interface:GLCapabilitiesImmutableReturns whether double-buffering is requested, available or chosen.Default is true.
- Specified by:
getDoubleBufferedin interfaceGLCapabilitiesImmutable
-
setDoubleBuffered
public void setDoubleBuffered(boolean enable) Enables or disables double buffering. -
getStereo
public final boolean getStereo()Description copied from interface:GLCapabilitiesImmutableReturns whether stereo is requested, available or chosen.Default is false.
- Specified by:
getStereoin interfaceGLCapabilitiesImmutable
-
setStereo
public void setStereo(boolean enable) Enables or disables stereo viewing. -
getHardwareAccelerated
public final boolean getHardwareAccelerated()Description copied from interface:GLCapabilitiesImmutableReturns whether hardware acceleration is requested, available or chosen.Default is true.
- Specified by:
getHardwareAcceleratedin interfaceGLCapabilitiesImmutable
-
setHardwareAccelerated
public void setHardwareAccelerated(boolean enable) Enables or disables hardware acceleration. -
getDepthBits
public final int getDepthBits()Description copied from interface:GLCapabilitiesImmutableReturns the number of depth buffer bits.- Specified by:
getDepthBitsin interfaceGLCapabilitiesImmutable
-
setDepthBits
public void setDepthBits(int depthBits) Sets the number of bits requested for the depth buffer. -
getStencilBits
public final int getStencilBits()Description copied from interface:GLCapabilitiesImmutableReturns the number of stencil buffer bits.Default is 0.
- Specified by:
getStencilBitsin interfaceGLCapabilitiesImmutable
-
setStencilBits
public void setStencilBits(int stencilBits) Sets the number of bits requested for the stencil buffer. -
getAccumRedBits
public final int getAccumRedBits()Description copied from interface:GLCapabilitiesImmutableReturns the number of bits for the accumulation buffer's red component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.- Specified by:
getAccumRedBitsin interfaceGLCapabilitiesImmutable
-
setAccumRedBits
public void setAccumRedBits(int accumRedBits) Sets the number of bits requested for the accumulation buffer's red component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered. -
getAccumGreenBits
public final int getAccumGreenBits()Description copied from interface:GLCapabilitiesImmutableReturns the number of bits for the accumulation buffer's green component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.- Specified by:
getAccumGreenBitsin interfaceGLCapabilitiesImmutable
-
setAccumGreenBits
public void setAccumGreenBits(int accumGreenBits) Sets the number of bits requested for the accumulation buffer's green component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered. -
getAccumBlueBits
public final int getAccumBlueBits()Description copied from interface:GLCapabilitiesImmutableReturns the number of bits for the accumulation buffer's blue component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.- Specified by:
getAccumBlueBitsin interfaceGLCapabilitiesImmutable
-
setAccumBlueBits
public void setAccumBlueBits(int accumBlueBits) Sets the number of bits requested for the accumulation buffer's blue component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered. -
getAccumAlphaBits
public final int getAccumAlphaBits()Description copied from interface:GLCapabilitiesImmutableReturns the number of bits for the accumulation buffer's alpha component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.- Specified by:
getAccumAlphaBitsin interfaceGLCapabilitiesImmutable
-
setAccumAlphaBits
public void setAccumAlphaBits(int accumAlphaBits) Sets number of bits requested for accumulation buffer's alpha component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered. -
setSampleExtension
Sets the desired extension for full-scene antialiasing (FSAA), default isGLCapabilitiesImmutable.DEFAULT_SAMPLE_EXTENSION. -
getSampleExtension
Description copied from interface:GLCapabilitiesImmutableReturns the extension for full-scene antialiasing (FSAA).Default is
GLCapabilitiesImmutable.DEFAULT_SAMPLE_EXTENSION.- Specified by:
getSampleExtensionin interfaceGLCapabilitiesImmutable
-
setSampleBuffers
public void setSampleBuffers(boolean enable) Defaults to false.
Indicates whether sample buffers for full-scene antialiasing (FSAA) should be allocated for this drawable.
Mind that this requires the alpha component.
If enabled this method also invokessetAlphaBits(1)ifCapabilities.getAlphaBits()== 0. -
getSampleBuffers
public final boolean getSampleBuffers()Description copied from interface:GLCapabilitiesImmutableReturns whether sample buffers for full-scene antialiasing (FSAA) should be allocated for this drawable.Default is false.
- Specified by:
getSampleBuffersin interfaceGLCapabilitiesImmutable
-
setNumSamples
public void setNumSamples(int numSamples) If sample buffers are enabled, indicates the number of buffers to be allocated. Defaults to 2.- See Also:
-
getNumSamples
public final int getNumSamples()Description copied from interface:GLCapabilitiesImmutableReturns the number of sample buffers to be allocated if sample buffers are enabled, otherwise returns 0.Default is 0 due to disable sample buffers per default.
- Specified by:
getNumSamplesin interfaceGLCapabilitiesImmutable
-
toString
Description copied from interface:com.jogamp.nativewindow.CapabilitiesImmutableReturn a textual representation of this object. Use the given StringBuilder [optional].- Specified by:
toStringin interfaceCapabilitiesImmutable- Overrides:
toStringin classCapabilities
-
toString
Returns a textual representation of this GLCapabilities object.- Specified by:
toStringin interfaceCapabilitiesImmutable- Specified by:
toStringin interfaceGLCapabilitiesImmutable- Overrides:
toStringin classCapabilities
-