Top Description Fields Constructors Methods
com.jogamp.nativewindow

public Class Capabilities

extends Object
implements CapabilitiesImmutable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, com.jogamp.nativewindow.CapabilitiesImmutable, java.lang.Comparable, com.jogamp.common.type.WriteCloneable, com.jogamp.nativewindow.VisualIDHolder
Known Direct Subclasses
com.jogamp.opengl.GLCapabilities, jogamp.nativewindow.x11.X11Capabilities

Specifies a set of capabilities that a window's rendering context must support, such as color depth per channel. 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 boolean
private int
protected static final String
CSEP

Component separator

protected static final String
ESEP

Element separator

private int
private boolean
protected static final String
private boolean
private int
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
Capabilities()

Creates a Capabilities object.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public Object
cloneMutable()

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

Get a mutable clone from this instance.
public int
compareTo(final CapabilitiesImmutable
the object to be compared.
caps
)

Implements java.lang.Comparable.compareTo.

Comparing RGBA values only
public Capabilities

Returns:

this instance
copyFrom
(final CapabilitiesImmutable other)

Copies all Capabilities values from source into this instance.

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

Overrides java.lang.Object.equals.

Implements com.jogamp.nativewindow.CapabilitiesImmutable.equals.

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

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getAlphaBits.

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

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getBlueBits.

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

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getGreenBits.

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

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getRedBits.

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

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentAlphaValue.

Gets the transparent alpha value for the frame buffer configuration.
public final int
getTransparentBlueValue()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentBlueValue.

Gets the transparent blue value for the frame buffer configuration.
public final int
getTransparentGreenValue()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentGreenValue.

Gets the transparent green value for the frame buffer configuration.
public final int
getTransparentRedValue()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentRedValue.

Gets the transparent red value for the frame buffer configuration.
public int
getVisualID(final VisualIDHolder.VIDType type)

Implements com.jogamp.nativewindow.VisualIDHolder.getVisualID.

Returns the native visual ID of the given type if supported, or VID_UNDEFINED if not supported.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements com.jogamp.nativewindow.CapabilitiesImmutable.hashCode.

hash code over the immutable attributes of both objects
public final boolean
isBackgroundOpaque()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.isBackgroundOpaque.

Returns whether an opaque or translucent surface is requested, supported or chosen.
public boolean
isBitmap()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.isBitmap.

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

Implements com.jogamp.nativewindow.CapabilitiesImmutable.isOnscreen.

Returns whether an on- or offscreen surface is requested, available or chosen.
protected StringBuilder
onoffScreenToString(StringBuilder sink)

Return a textual representation of this object's on/off screen state.

public void
setAlphaBits(final int alphaBits)

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

public void
setBackgroundOpaque(final boolean opaque)

Sets whether the surface shall be opaque or translucent.

public void
setBitmap(final boolean enable)

Requesting offscreen bitmap mode.

public void
setBlueBits(final int blueBits)

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

public void
setGreenBits(final int greenBits)

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

public void
setOnscreen(final boolean onscreen)

Sets whether the surface shall be on- or offscreen.

public void
setRedBits(final int redBits)

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

public void
setTransparentAlphaValue(final int transValueAlpha)

Sets the transparent alpha value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for alpha.

public void
setTransparentBlueValue(final int transValueBlue)

Sets the transparent blue value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for blue.

public void
setTransparentGreenValue(final int transValueGreen)

Sets the transparent green value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for green.

public void
setTransparentRedValue(final int transValueRed)

Sets the transparent red value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for red.

protected final String
toHexString(final int val)

public StringBuilder
toString(final StringBuilder sink)

Implements com.jogamp.nativewindow.CapabilitiesImmutable.toString.

Return a textual representation of this object.
public String
toString()

Overrides java.lang.Object.toString.

Implements com.jogamp.nativewindow.CapabilitiesImmutable.toString.

Returns a textual representation of this Capabilities object.
protected StringBuilder
toString(StringBuilder sink, final boolean withOnOffScreen)

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

alphaBitsback to summary
private int alphaBits
backgroundOpaqueback to summary
private boolean backgroundOpaque
blueBitsback to summary
private int blueBits
CSEPback to summary
protected static final String CSEP

Component separator

ESEPback to summary
protected static final String ESEP

Element separator

greenBitsback to summary
private int greenBits
isBitmapback to summary
private boolean isBitmap
na_strback to summary
protected static final String na_str
onscreenback to summary
private boolean onscreen
redBitsback to summary
private int redBits
transparentValueAlphaback to summary
private int transparentValueAlpha
transparentValueBlueback to summary
private int transparentValueBlue
transparentValueGreenback to summary
private int transparentValueGreen
transparentValueRedback to summary
private int transparentValueRed

Constructor Detail

Capabilitiesback to summary
public Capabilities()

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

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.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()

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 caps)

Implements java.lang.Comparable.compareTo.

Comparing RGBA values only

Parameters
caps: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 Capabilities copyFrom(final CapabilitiesImmutable other)

Copies all Capabilities values from source into this instance.

Returns:Capabilities

this instance

equalsback to summary
public boolean equals(final Object obj)

Overrides java.lang.Object.equals.

Implements 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
getAlphaBitsback to summary
public final int getAlphaBits()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getAlphaBits.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.getAlphaBits.

Returns the number of bits for the color buffer's alpha component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

Annotations
@Override
getBlueBitsback to summary
public final int getBlueBits()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getBlueBits.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.getBlueBits.

Returns the number of bits for the color buffer's blue component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

Annotations
@Override
getGreenBitsback to summary
public final int getGreenBits()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getGreenBits.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.getGreenBits.

Returns the number of bits for the color buffer's green component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

Annotations
@Override
getRedBitsback to summary
public final int getRedBits()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getRedBits.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.getRedBits.

Returns the number of bits for the color buffer's red component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

Annotations
@Override
getTransparentAlphaValueback to summary
public final int getTransparentAlphaValue()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentAlphaValue.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentAlphaValue.

Gets the transparent alpha value for the frame buffer configuration. This value is undefined if; equals true.

Annotations
@Override
getTransparentBlueValueback to summary
public final int getTransparentBlueValue()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentBlueValue.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentBlueValue.

Gets the transparent blue value for the frame buffer configuration. This value is undefined if; equals true.

Annotations
@Override
getTransparentGreenValueback to summary
public final int getTransparentGreenValue()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentGreenValue.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentGreenValue.

Gets the transparent green value for the frame buffer configuration. This value is undefined if; equals true.

Annotations
@Override
getTransparentRedValueback to summary
public final int getTransparentRedValue()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentRedValue.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.getTransparentRedValue.

Gets the transparent red value for the frame buffer configuration. This value is undefined if; equals true.

Annotations
@Override
getVisualIDback to summary
public int getVisualID(final VisualIDHolder.VIDType type) throws NativeWindowException

Implements com.jogamp.nativewindow.VisualIDHolder.getVisualID.

Doc from com.jogamp.nativewindow.VisualIDHolder.getVisualID.

Returns the native visual ID of the given type if supported, or VID_UNDEFINED if not supported.

Depending on the native windowing system, type is handled as follows:

  • X11 throws NativeWindowException on EGL_CONFIG, WIN32_PFD
    • INTRINSIC: X11 XVisual ID
    • NATIVE: X11 XVisual ID
    • X11_XVISUAL: X11 XVisual ID
    • X11_FBCONFIG: VID_UNDEFINED
  • X11/GL throws NativeWindowException on EGL_CONFIG, WIN32_PFD
    • INTRINSIC: X11 XVisual ID
    • NATIVE: X11 XVisual ID
    • X11_XVISUAL: X11 XVisual ID
    • X11_FBCONFIG: X11 FBConfig ID or VID_UNDEFINED
  • Windows/GL throws NativeWindowException on EGL_CONFIG, X11_XVISUAL, X11_FBCONFIG
    • INTRINSIC: Win32 PIXELFORMATDESCRIPTOR ID
    • NATIVE: Win32 PIXELFORMATDESCRIPTOR ID
    • WIN32_PFD: Win32 PIXELFORMATDESCRIPTOR ID
  • EGL/GL throws NativeWindowException on X11_XVISUAL, X11_FBCONFIG, WIN32_PFD
    • INTRINSIC: EGL Config ID
    • NATIVE: EGL NativeVisual ID (X11 XVisual ID, Win32 PIXELFORMATDESCRIPTOR ID, ...)
    • EGL_CONFIG: EGL Config ID

Note: INTRINSIC and NATIVE are always handled, but may result in VID_UNDEFINED. The latter is true if the native value are actually undefined or the corresponding object is not mapped to a native visual object.
Annotations
@Override
Exceptions
NativeWindowException:
if type is neither INTRINSIC nor NATIVE and does not match the native implementation.
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements 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
isBackgroundOpaqueback to summary
public final boolean isBackgroundOpaque()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.isBackgroundOpaque.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.isBackgroundOpaque.

Returns whether an opaque or translucent surface is requested, supported or chosen.

Default is true, i.e. opaque.

Annotations
@Override
isBitmapback to summary
public boolean isBitmap()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.isBitmap.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.isBitmap.

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

Default is false.

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

Annotations
@Override
isOnscreenback to summary
public final boolean isOnscreen()

Implements com.jogamp.nativewindow.CapabilitiesImmutable.isOnscreen.

Doc from com.jogamp.nativewindow.CapabilitiesImmutable.isOnscreen.

Returns whether an on- or offscreen surface is requested, available or chosen.

Default is true, i.e. onscreen.

Mind that an capabilities intance w/ available semantics may show onscreen, but also the offscreen modes FBO, Pbuffer or bitmap. This is valid, since one native configuration maybe used for either functionality.

Annotations
@Override
onoffScreenToStringback to summary
protected StringBuilder onoffScreenToString(StringBuilder sink)

Return a textual representation of this object's on/off screen state. Use the given StringBuilder [optional].

setAlphaBitsback to summary
public void setAlphaBits(final int alphaBits)

Sets the number of bits requested for the color buffer's alpha component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

Note

If alpha bits are zero, they are set to one by setBackgroundOpaque(boolean) and it's OpenGL specialization GLCapabilities::setSampleBuffers(boolean).
Ensure to call this method after the above to ensure a zero value.
The above automated settings takes into account, that the user calls this method to request alpha bits, not to reflect a current state. Nevertheless if this is the case - call it at last.

setBackgroundOpaqueback to summary
public void setBackgroundOpaque(final boolean opaque)

Sets whether the surface shall be opaque or translucent.

Platform implementations may need an alpha component in the surface (eg. Windows), or expect pre-multiplied alpha values (eg. X11/XRender).
To unify the experience, this method also invokes setAlphaBits(1) if getAlphaBits() == 0.
Please note that in case alpha is required on the platform the clear color shall have an alpha lower than 1.0 to allow anything shining through.

Mind that translucency may cause a performance penalty due to the composite work required by the window manager.

setBitmapback to summary
public void setBitmap(final boolean enable)

Requesting offscreen bitmap mode.

If enabled this method also invokes setOnscreen(false).

Defaults to false.

Requesting offscreen bitmap mode disables the offscreen auto selection.

setBlueBitsback to summary
public void setBlueBits(final int blueBits)

Sets the number of bits requested for the color buffer's blue component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

setGreenBitsback to summary
public void setGreenBits(final int greenBits)

Sets the number of bits requested for the color buffer's green component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

setOnscreenback to summary
public void setOnscreen(final boolean onscreen)

Sets whether the surface shall be on- or offscreen.

Defaults to true.

If requesting an offscreen surface without further selection of it's mode, e.g. FBO, Pbuffer or bitmap, the implementation will choose the best available offscreen mode.

setRedBitsback to summary
public void setRedBits(final int redBits)

Sets the number of bits requested for the color buffer's red component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

setTransparentAlphaValueback to summary
public void setTransparentAlphaValue(final int transValueAlpha)

Sets the transparent alpha value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for alpha. This value is ignored if isBackgroundOpaque() equals true.
It defaults to half of the frambuffer value for alpha.
A value of -1 is interpreted as any value.

setTransparentBlueValueback to summary
public void setTransparentBlueValue(final int transValueBlue)

Sets the transparent blue value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for blue. This value is ignored if isBackgroundOpaque() equals true.
It defaults to half of the frambuffer value for blue.
A value of -1 is interpreted as any value.

setTransparentGreenValueback to summary
public void setTransparentGreenValue(final int transValueGreen)

Sets the transparent green value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for green. This value is ignored if isBackgroundOpaque() equals true.
It defaults to half of the frambuffer value for green.
A value of -1 is interpreted as any value.

setTransparentRedValueback to summary
public void setTransparentRedValue(final int transValueRed)

Sets the transparent red value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for red. This value is ignored if isBackgroundOpaque() equals true.
It defaults to half of the frambuffer value for red.
A value of -1 is interpreted as any value.

toHexStringback to summary
protected final String toHexString(final int val)
toStringback to summary
public StringBuilder toString(final StringBuilder sink)

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 java.lang.Object.toString.

Implements com.jogamp.nativewindow.CapabilitiesImmutable.toString.

Returns a textual representation of this Capabilities object.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override
toStringback to summary
protected StringBuilder toString(StringBuilder sink, final boolean withOnOffScreen)