Top Description Fields Constructors Methods
com.jogamp.opengl

public Class GLCapabilities

extends Capabilities
implements Cloneable, GLCapabilitiesImmutable
Class Inheritance
All Implemented Interfaces
com.jogamp.opengl.GLCapabilitiesImmutable, com.jogamp.nativewindow.CapabilitiesImmutable, java.lang.Comparable, com.jogamp.common.type.WriteCloneable, com.jogamp.nativewindow.VisualIDHolder, java.lang.Cloneable
Known Direct Subclasses
jogamp.opengl.egl.EGLGLCapabilities, jogamp.opengl.windows.wgl.WGLGLCapabilities, jogamp.opengl.x11.glx.X11GLCapabilities
Imports
com.jogamp.nativewindow.Capabilities, .CapabilitiesImmutable

Specifies a set of OpenGL capabilities.
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.

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private int
private int
private boolean
private GLProfile
private boolean
private boolean
private boolean
private int
private boolean
private String
private int
private boolean
Inherited from com.jogamp.nativewindow.Capabilities:
CSEPESEPna_str

Constructor Summary

AccessConstructor and Description
public
GLCapabilities(final GLProfile
GLProfile, or null for the default GLProfile
glp
)

Creates a GLCapabilities object.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides com.jogamp.nativewindow.Capabilities.clone.

Creates and returns a copy of this object.
public Object
public int
compareTo(final CapabilitiesImmutable
the object to be compared.
o
)

Overrides com.jogamp.nativewindow.Capabilities.compareTo.

Implements java.lang.Comparable.compareTo.

comparing hw/sw, stereo, multisample, stencil, RGBA and depth only
public GLCapabilities

Returns:

this instance
copyFrom
(final GLCapabilitiesImmutable source)

Copies all GLCapabilitiesImmutable values from source into this instance.

public boolean
equals(final Object
the reference object with which to compare.
obj
)

Overrides com.jogamp.nativewindow.Capabilities.equals.

Implements com.jogamp.opengl.GLCapabilitiesImmutable.equals, com.jogamp.nativewindow.CapabilitiesImmutable.equals.

Equality over the immutable attributes of both objects
public final int
getAccumAlphaBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getAccumAlphaBits.

Returns the number of bits for the accumulation buffer's alpha component.
public final int
getAccumBlueBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getAccumBlueBits.

Returns the number of bits for the accumulation buffer's blue component.
public final int
getAccumGreenBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getAccumGreenBits.

Returns the number of bits for the accumulation buffer's green component.
public final int
getAccumRedBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getAccumRedBits.

Returns the number of bits for the accumulation buffer's red component.
public final int
getDepthBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getDepthBits.

Returns the number of depth buffer bits.
public final boolean
getDoubleBuffered()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getDoubleBuffered.

Returns whether double-buffering is requested, available or chosen.
public final GLProfile
getGLProfile()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getGLProfile.

Returns the GL profile you desire or used by the drawable.
public final boolean
getHardwareAccelerated()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getHardwareAccelerated.

Returns whether hardware acceleration is requested, available or chosen.
public final int
getNumSamples()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getNumSamples.

Returns the number of sample buffers to be allocated if sample buffers are enabled, otherwise returns 0.
public final boolean
getSampleBuffers()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getSampleBuffers.

Returns whether sample buffers for full-scene antialiasing (FSAA) should be allocated for this drawable.
public final String
getSampleExtension()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getSampleExtension.

Returns the extension for full-scene antialiasing (FSAA).
public final int
getStencilBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getStencilBits.

Returns the number of stencil buffer bits.
public final boolean
getStereo()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getStereo.

Returns whether stereo is requested, available or chosen.
public int
public final boolean
isFBO()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.isFBO.

Returns whether FBO offscreen mode is requested, available or chosen.
public final boolean
isPBuffer()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.isPBuffer.

Returns whether pbuffer offscreen mode is requested, available or chosen.
public void
setAccumAlphaBits(final int accumAlphaBits)

Sets number of bits requested for accumulation buffer's alpha component.

public void
setAccumBlueBits(final int accumBlueBits)

Sets the number of bits requested for the accumulation buffer's blue component.

public void
setAccumGreenBits(final int accumGreenBits)

Sets the number of bits requested for the accumulation buffer's green component.

public void
setAccumRedBits(final int accumRedBits)

Sets the number of bits requested for the accumulation buffer's red component.

public void
setDepthBits(final int depthBits)

Sets the number of bits requested for the depth buffer.

public void
setDoubleBuffered(final boolean enable)

Enables or disables double buffering.

public void
setFBO(final boolean enable)

Requesting offscreen FBO mode.

public void
setGLProfile(final GLProfile profile)

Sets the GL profile you desire

public void
setHardwareAccelerated(final boolean enable)

Enables or disables hardware acceleration.

public void
setNumSamples(final int numSamples)

If sample buffers are enabled, indicates the number of buffers to be allocated.

public void
setPBuffer(final boolean enable)

Requesting offscreen pbuffer mode.

public void
setSampleBuffers(final boolean enable)

Defaults to false.

public void
setSampleExtension(final String se)

Sets the desired extension for full-scene antialiasing (FSAA), default is DEFAULT_SAMPLE_EXTENSION.

public void
setStencilBits(final int stencilBits)

Sets the number of bits requested for the stencil buffer.

public void
setStereo(final boolean enable)

Enables or disables stereo viewing.

public StringBuilder
toString(StringBuilder sink)

Overrides com.jogamp.nativewindow.Capabilities.toString.

Implements com.jogamp.nativewindow.CapabilitiesImmutable.toString.

Return a textual representation of this object.
public String
Inherited from com.jogamp.nativewindow.Capabilities:
copyFromgetAlphaBitsgetBlueBitsgetGreenBitsgetRedBitsgetTransparentAlphaValuegetTransparentBlueValuegetTransparentGreenValuegetTransparentRedValuegetVisualIDisBackgroundOpaqueisBitmapisOnscreenonoffScreenToStringsetAlphaBitssetBackgroundOpaquesetBitmapsetBlueBitssetGreenBitssetOnscreensetRedBitssetTransparentAlphaValuesetTransparentBlueValuesetTransparentGreenValuesetTransparentRedValuetoHexStringtoString

Field Detail

accumAlphaBitsback to summary
private int accumAlphaBits
accumBlueBitsback to summary
private int accumBlueBits
accumGreenBitsback to summary
private int accumGreenBits
accumRedBitsback to summary
private int accumRedBits
depthBitsback to summary
private int depthBits
doubleBufferedback to summary
private boolean doubleBuffered
glProfileback to summary
private GLProfile glProfile
hardwareAcceleratedback to summary
private boolean hardwareAccelerated
isFBOback to summary
private boolean isFBO
isPBufferback to summary
private boolean isPBuffer
numSamplesback to summary
private int numSamples
sampleBuffersback to summary
private boolean sampleBuffers
sampleExtensionback to summary
private String sampleExtension
stencilBitsback to summary
private int stencilBits
stereoback to summary
private boolean stereo

Constructor Detail

GLCapabilitiesback to summary
public GLCapabilities(final GLProfile glp) throws GLException

Creates a GLCapabilities object. All attributes are in a default state.

Parameters
glp:GLProfile

GLProfile, or null for the default GLProfile

Exceptions
GLException:
if no profile is given and no default profile is available for the default device.

Method Detail

cloneback to summary
public Object clone()

Overrides com.jogamp.nativewindow.Capabilities.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
cloneMutableback to summary
public Object cloneMutable()

Overrides com.jogamp.nativewindow.Capabilities.cloneMutable.

Implements com.jogamp.common.type.WriteCloneable.cloneMutable.

Doc from com.jogamp.common.type.WriteCloneable.cloneMutable.

Get a mutable clone from this instance.

Annotations
@Override
compareToback to summary
public int compareTo(final CapabilitiesImmutable o)

Overrides com.jogamp.nativewindow.Capabilities.compareTo.

Implements java.lang.Comparable.compareTo.

comparing hw/sw, stereo, multisample, stencil, RGBA and depth only

Parameters
o:CapabilitiesImmutable

Doc from java.lang.Comparable.compareTo.

the object to be compared.

Returns:int

Doc from java.lang.Comparable.compareTo.

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
copyFromback to summary
public GLCapabilities copyFrom(final GLCapabilitiesImmutable source)

Copies all GLCapabilitiesImmutable values from source into this instance.

Returns:GLCapabilities

this instance

equalsback to summary
public boolean equals(final Object obj)

Overrides com.jogamp.nativewindow.Capabilities.equals.

Implements com.jogamp.opengl.GLCapabilitiesImmutable.equals, com.jogamp.nativewindow.CapabilitiesImmutable.equals.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.equals.

Equality over the immutable attributes of both objects

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAccumAlphaBitsback to summary
public final int getAccumAlphaBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getAccumAlphaBits.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getAccumAlphaBits.

Returns 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.

Annotations
@Override
getAccumBlueBitsback to summary
public final int getAccumBlueBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getAccumBlueBits.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getAccumBlueBits.

Returns 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.

Annotations
@Override
getAccumGreenBitsback to summary
public final int getAccumGreenBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getAccumGreenBits.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getAccumGreenBits.

Returns 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.

Annotations
@Override
getAccumRedBitsback to summary
public final int getAccumRedBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getAccumRedBits.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getAccumRedBits.

Returns 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.

Annotations
@Override
getDepthBitsback to summary
public final int getDepthBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getDepthBits.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getDepthBits.

Returns the number of depth buffer bits.

Annotations
@Override
getDoubleBufferedback to summary
public final boolean getDoubleBuffered()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getDoubleBuffered.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getDoubleBuffered.

Returns whether double-buffering is requested, available or chosen.

Default is true.

Annotations
@Override
getGLProfileback to summary
public final GLProfile getGLProfile()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getGLProfile.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getGLProfile.

Returns the GL profile you desire or used by the drawable.

Annotations
@Override
getHardwareAcceleratedback to summary
public final boolean getHardwareAccelerated()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getHardwareAccelerated.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getHardwareAccelerated.

Returns whether hardware acceleration is requested, available or chosen.

Default is true.

Annotations
@Override
getNumSamplesback to summary
public final int getNumSamples()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getNumSamples.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getNumSamples.

Returns 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.

Annotations
@Override
getSampleBuffersback to summary
public final boolean getSampleBuffers()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getSampleBuffers.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getSampleBuffers.

Returns whether sample buffers for full-scene antialiasing (FSAA) should be allocated for this drawable.

Default is false.

Annotations
@Override
getSampleExtensionback to summary
public final String getSampleExtension()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getSampleExtension.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getSampleExtension.

Returns the extension for full-scene antialiasing (FSAA).

Default is DEFAULT_SAMPLE_EXTENSION.

Annotations
@Override
getStencilBitsback to summary
public final int getStencilBits()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getStencilBits.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getStencilBits.

Returns the number of stencil buffer bits.

Default is 0.

Annotations
@Override
getStereoback to summary
public final boolean getStereo()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.getStereo.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.getStereo.

Returns whether stereo is requested, available or chosen.

Default is false.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides com.jogamp.nativewindow.Capabilities.hashCode.

Implements com.jogamp.opengl.GLCapabilitiesImmutable.hashCode, com.jogamp.nativewindow.CapabilitiesImmutable.hashCode.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.hashCode.

hash code over the immutable attributes of both objects

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object

Annotations
@Override
isFBOback to summary
public final boolean isFBO()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.isFBO.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.isFBO.

Returns whether FBO offscreen mode is requested, available or chosen.

Default is false.

For chosen capabilities, only the selected offscreen surface is set to true.

Annotations
@Override
isPBufferback to summary
public final boolean isPBuffer()

Implements com.jogamp.opengl.GLCapabilitiesImmutable.isPBuffer.

Doc from com.jogamp.opengl.GLCapabilitiesImmutable.isPBuffer.

Returns whether pbuffer offscreen mode is requested, available or chosen.

Default is false.

For chosen capabilities, only the selected offscreen surface is set to true.

Annotations
@Override
setAccumAlphaBitsback to summary
public void setAccumAlphaBits(final 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.

setAccumBlueBitsback to summary
public void setAccumBlueBits(final 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.

setAccumGreenBitsback to summary
public void setAccumGreenBits(final 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.

setAccumRedBitsback to summary
public void setAccumRedBits(final 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.

setDepthBitsback to summary
public void setDepthBits(final int depthBits)

Sets the number of bits requested for the depth buffer.

setDoubleBufferedback to summary
public void setDoubleBuffered(final boolean enable)

Enables or disables double buffering.

setFBOback to summary
public void setFBO(final 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.

setGLProfileback to summary
public void setGLProfile(final GLProfile profile)

Sets the GL profile you desire

setHardwareAcceleratedback to summary
public void setHardwareAccelerated(final boolean enable)

Enables or disables hardware acceleration.

setNumSamplesback to summary
public void setNumSamples(final int numSamples)

If sample buffers are enabled, indicates the number of buffers to be allocated. Defaults to 2.

See Also
getNumSamples()
setPBufferback to summary
public void setPBuffer(final 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.

setSampleBuffersback to summary
public void setSampleBuffers(final 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 invokes setAlphaBits(1) if getAlphaBits() == 0.

setSampleExtensionback to summary
public void setSampleExtension(final String se)

Sets the desired extension for full-scene antialiasing (FSAA), default is DEFAULT_SAMPLE_EXTENSION.

setStencilBitsback to summary
public void setStencilBits(final int stencilBits)

Sets the number of bits requested for the stencil buffer.

setStereoback to summary
public void setStereo(final boolean enable)

Enables or disables stereo viewing.

toStringback to summary
public StringBuilder toString(StringBuilder sink)

Overrides com.jogamp.nativewindow.Capabilities.toString.

Implements com.jogamp.nativewindow.CapabilitiesImmutable.toString.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.toString.

Return a textual representation of this object. Use the given StringBuilder [optional].

Annotations
@Override
toStringback to summary
public String toString()

Overrides com.jogamp.nativewindow.Capabilities.toString.

Implements com.jogamp.opengl.GLCapabilitiesImmutable.toString, com.jogamp.nativewindow.CapabilitiesImmutable.toString.

Returns a textual representation of this GLCapabilities object.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override