Class Capabilities
- All Implemented Interfaces:
com.jogamp.common.type.WriteCloneable,CapabilitiesImmutable,VisualIDHolder,Cloneable,Comparable<CapabilitiesImmutable>
- Direct Known Subclasses:
GLCapabilities
-
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.nativewindow.VisualIDHolder
VID_UNDEFINED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()intComparing RGBA values onlycopyFrom(CapabilitiesImmutable other) Copies allCapabilitiesvalues fromsourceinto this instance.booleanEquality over the immutable attributes of both objectsfinal intReturns the number of bits for the color buffer's alpha component.final intReturns the number of bits for the color buffer's blue component.final intReturns the number of bits for the color buffer's green component.final intReturns the number of bits for the color buffer's red component.final intGets the transparent alpha value for the frame buffer configuration.final intGets the transparent blue value for the frame buffer configuration.final intGets the transparent green value for the frame buffer configuration.final intGets the transparent red value for the frame buffer configuration.intReturns the native visual ID of the giventypeif supported, orVisualIDHolder.VID_UNDEFINEDif not supported.inthashCode()hash code over the immutable attributes of both objectsfinal booleanReturns whether an opaque or translucent surface is requested, supported or chosen.booleanisBitmap()Returns whether bitmap offscreen mode is requested, available or chosen.final booleanReturns whether an on- or offscreen surface is requested, available or chosen.voidsetAlphaBits(int alphaBits) Sets the number of bits requested for the color buffer's alpha component.voidsetBackgroundOpaque(boolean opaque) Sets whether the surface shall be opaque or translucent.voidsetBitmap(boolean enable) Requesting offscreen bitmap mode.voidsetBlueBits(int blueBits) Sets the number of bits requested for the color buffer's blue component.voidsetGreenBits(int greenBits) Sets the number of bits requested for the color buffer's green component.voidsetOnscreen(boolean onscreen) Sets whether the surface shall be on- or offscreen.voidsetRedBits(int redBits) Sets the number of bits requested for the color buffer's red component.voidsetTransparentAlphaValue(int transValueAlpha) Sets the transparent alpha value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for alpha.voidsetTransparentBlueValue(int transValueBlue) Sets the transparent blue value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for blue.voidsetTransparentGreenValue(int transValueGreen) Sets the transparent green value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for green.voidsetTransparentRedValue(int transValueRed) Sets the transparent red value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for red.toString()Returns a textual representation of this Capabilities object.toString(StringBuilder sink) Return a textual representation of this object.
-
Constructor Details
-
Capabilities
public Capabilities()Creates a Capabilities object. All attributes are in a default state.
-
-
Method Details
-
cloneMutable
- Specified by:
cloneMutablein interfacecom.jogamp.common.type.WriteCloneable
-
clone
-
copyFrom
Copies allCapabilitiesvalues fromsourceinto this instance.- Returns:
- this instance
-
hashCode
public int hashCode()Description copied from interface:CapabilitiesImmutablehash code over the immutable attributes of both objects- Specified by:
hashCodein interfaceCapabilitiesImmutable- Overrides:
hashCodein classObject
-
equals
Description copied from interface:CapabilitiesImmutableEquality over the immutable attributes of both objects- Specified by:
equalsin interfaceCapabilitiesImmutable- Overrides:
equalsin classObject
-
compareTo
Comparing RGBA values only- Specified by:
compareToin interfaceComparable<CapabilitiesImmutable>
-
getVisualID
Description copied from interface:VisualIDHolderReturns the native visual ID of the giventypeif supported, orVisualIDHolder.VID_UNDEFINEDif not supported.Depending on the native windowing system,
typeis handled as follows:- X11 throws NativeWindowException on
EGL_CONFIG,WIN32_PFDINTRINSIC: X11 XVisual IDNATIVE: X11 XVisual IDX11_XVISUAL: X11 XVisual IDX11_FBCONFIG:VID_UNDEFINED
- X11/GL throws NativeWindowException on
EGL_CONFIG,WIN32_PFDINTRINSIC: X11 XVisual IDNATIVE: X11 XVisual IDX11_XVISUAL: X11 XVisual IDX11_FBCONFIG: X11 FBConfig ID orVID_UNDEFINED
- Windows/GL throws NativeWindowException on
EGL_CONFIG,X11_XVISUAL,X11_FBCONFIGINTRINSIC: Win32 PIXELFORMATDESCRIPTOR IDNATIVE: Win32 PIXELFORMATDESCRIPTOR IDWIN32_PFD: Win32 PIXELFORMATDESCRIPTOR ID
- EGL/GL throws NativeWindowException on
X11_XVISUAL,X11_FBCONFIG,WIN32_PFDINTRINSIC: EGL Config IDNATIVE: EGL NativeVisual ID (X11 XVisual ID, Win32 PIXELFORMATDESCRIPTOR ID, ...)EGL_CONFIG: EGL Config ID
INTRINSICandNATIVEare always handled, but may result inVisualIDHolder.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.- Specified by:
getVisualIDin interfaceVisualIDHolder- Throws:
NativeWindowException- iftypeis neitherINTRINSICnorNATIVEand does not match the native implementation.
- X11 throws NativeWindowException on
-
getRedBits
public final int getRedBits()Description copied from interface:CapabilitiesImmutableReturns 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.- Specified by:
getRedBitsin interfaceCapabilitiesImmutable
-
setRedBits
public void setRedBits(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. -
getGreenBits
public final int getGreenBits()Description copied from interface:CapabilitiesImmutableReturns 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.- Specified by:
getGreenBitsin interfaceCapabilitiesImmutable
-
setGreenBits
public void setGreenBits(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. -
getBlueBits
public final int getBlueBits()Description copied from interface:CapabilitiesImmutableReturns 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.- Specified by:
getBlueBitsin interfaceCapabilitiesImmutable
-
setBlueBits
public void setBlueBits(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. -
getAlphaBits
public final int getAlphaBits()Description copied from interface:CapabilitiesImmutableReturns 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.- Specified by:
getAlphaBitsin interfaceCapabilitiesImmutable
-
setAlphaBits
public void setAlphaBits(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 toonebysetBackgroundOpaque(boolean)and it's OpenGL specializationGLCapabilities::setSampleBuffers(boolean).
Ensure to call this method after the above to ensure azerovalue. 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. -
setBackgroundOpaque
public void setBackgroundOpaque(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 invokessetAlphaBits(1)ifgetAlphaBits()== 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.
-
isBackgroundOpaque
public final boolean isBackgroundOpaque()Description copied from interface:CapabilitiesImmutableReturns whether an opaque or translucent surface is requested, supported or chosen.Default is true, i.e. opaque.
- Specified by:
isBackgroundOpaquein interfaceCapabilitiesImmutable
-
setOnscreen
public void setOnscreen(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.- Parameters:
onscreen-
-
isOnscreen
public final boolean isOnscreen()Description copied from interface:CapabilitiesImmutableReturns 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.- Specified by:
isOnscreenin interfaceCapabilitiesImmutable
-
setBitmap
public void setBitmap(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.
-
isBitmap
public boolean isBitmap()Description copied from interface:CapabilitiesImmutableReturns whether bitmap offscreen mode is requested, available or chosen.Default is false.
For chosen capabilities, only the selected offscreen surface is set to
true.- Specified by:
isBitmapin interfaceCapabilitiesImmutable
-
getTransparentRedValue
public final int getTransparentRedValue()Description copied from interface:CapabilitiesImmutableGets the transparent red value for the frame buffer configuration. This value is undefined if; equals true.- Specified by:
getTransparentRedValuein interfaceCapabilitiesImmutable
-
getTransparentGreenValue
public final int getTransparentGreenValue()Description copied from interface:CapabilitiesImmutableGets the transparent green value for the frame buffer configuration. This value is undefined if; equals true.- Specified by:
getTransparentGreenValuein interfaceCapabilitiesImmutable
-
getTransparentBlueValue
public final int getTransparentBlueValue()Description copied from interface:CapabilitiesImmutableGets the transparent blue value for the frame buffer configuration. This value is undefined if; equals true.- Specified by:
getTransparentBlueValuein interfaceCapabilitiesImmutable
-
getTransparentAlphaValue
public final int getTransparentAlphaValue()Description copied from interface:CapabilitiesImmutableGets the transparent alpha value for the frame buffer configuration. This value is undefined if; equals true.- Specified by:
getTransparentAlphaValuein interfaceCapabilitiesImmutable
-
setTransparentRedValue
public void setTransparentRedValue(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 ifisBackgroundOpaque()equals true.
It defaults to half of the frambuffer value for red.
A value of -1 is interpreted as any value. -
setTransparentGreenValue
public void setTransparentGreenValue(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 ifisBackgroundOpaque()equals true.
It defaults to half of the frambuffer value for green.
A value of -1 is interpreted as any value. -
setTransparentBlueValue
public void setTransparentBlueValue(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 ifisBackgroundOpaque()equals true.
It defaults to half of the frambuffer value for blue.
A value of -1 is interpreted as any value. -
setTransparentAlphaValue
public void setTransparentAlphaValue(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 ifisBackgroundOpaque()equals true.
It defaults to half of the frambuffer value for alpha.
A value of -1 is interpreted as any value. -
toString
Description copied from interface:CapabilitiesImmutableReturn a textual representation of this object. Use the given StringBuilder [optional].- Specified by:
toStringin interfaceCapabilitiesImmutable
-
toString
Returns a textual representation of this Capabilities object.- Specified by:
toStringin interfaceCapabilitiesImmutable- Overrides:
toStringin classObject
-