Package com.jogamp.nativewindow
Class DefaultGraphicsConfiguration
- java.lang.Object
-
- com.jogamp.nativewindow.DefaultGraphicsConfiguration
-
- All Implemented Interfaces:
AbstractGraphicsConfiguration
,VisualIDHolder
,Cloneable
- Direct Known Subclasses:
AWTGraphicsConfiguration
,MutableGraphicsConfiguration
public class DefaultGraphicsConfiguration extends Object implements Cloneable, AbstractGraphicsConfiguration
-
-
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 Constructor Description DefaultGraphicsConfiguration(AbstractGraphicsScreen screen, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
CapabilitiesImmutable
getChosenCapabilities()
Return the capabilities reflecting this graphics configuration, which may differ from the capabilities used to choose this configuration.AbstractGraphicsConfiguration
getNativeGraphicsConfiguration()
In case the implementation utilizes a delegation pattern to wrap abstract toolkits, this method shall return the nativeAbstractGraphicsConfiguration
, otherwise this instance.CapabilitiesImmutable
getRequestedCapabilities()
Return the capabilities used to choose this graphics configuration.AbstractGraphicsScreen
getScreen()
Return the screen this graphics configuration is valid forint
getVisualID(VisualIDHolder.VIDType type)
Returns the native visual ID of the giventype
if supported, orVisualIDHolder.VID_UNDEFINED
if not supported.boolean
isVisualIDSupported(VisualIDHolder.VIDType type)
Returns true if the givenVisualIDHolder.VIDType
is supported, otherwise false.static String
toHexString(int val)
static String
toHexString(long val)
String
toString()
-
-
-
Constructor Detail
-
DefaultGraphicsConfiguration
public DefaultGraphicsConfiguration(AbstractGraphicsScreen screen, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested)
-
-
Method Detail
-
clone
public Object clone()
- Specified by:
clone
in interfaceAbstractGraphicsConfiguration
-
getScreen
public final AbstractGraphicsScreen getScreen()
Description copied from interface:AbstractGraphicsConfiguration
Return the screen this graphics configuration is valid for- Specified by:
getScreen
in interfaceAbstractGraphicsConfiguration
-
getChosenCapabilities
public final CapabilitiesImmutable getChosenCapabilities()
Description copied from interface:AbstractGraphicsConfiguration
Return the capabilities reflecting this graphics configuration, which may differ from the capabilities used to choose this configuration.- Specified by:
getChosenCapabilities
in interfaceAbstractGraphicsConfiguration
- Returns:
- An immutable instance of the Capabilities to avoid mutation by the user.
-
getRequestedCapabilities
public final CapabilitiesImmutable getRequestedCapabilities()
Description copied from interface:AbstractGraphicsConfiguration
Return the capabilities used to choose this graphics configuration. These may be used to reconfigure the NativeWindow in case the device changes in a multiple screen environment.- Specified by:
getRequestedCapabilities
in interfaceAbstractGraphicsConfiguration
- Returns:
- An immutable instance of the Capabilities to avoid mutation by the user.
-
getNativeGraphicsConfiguration
public AbstractGraphicsConfiguration getNativeGraphicsConfiguration()
Description copied from interface:AbstractGraphicsConfiguration
In case the implementation utilizes a delegation pattern to wrap abstract toolkits, this method shall return the nativeAbstractGraphicsConfiguration
, otherwise this instance.- Specified by:
getNativeGraphicsConfiguration
in interfaceAbstractGraphicsConfiguration
- See Also:
NativeSurface.getGraphicsConfiguration()
-
getVisualID
public final int getVisualID(VisualIDHolder.VIDType type) throws NativeWindowException
Description copied from interface:VisualIDHolder
Returns the native visual ID of the giventype
if supported, orVisualIDHolder.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 IDNATIVE
: X11 XVisual IDX11_XVISUAL
: X11 XVisual IDX11_FBCONFIG
:VID_UNDEFINED
- X11/GL throws NativeWindowException on
EGL_CONFIG
,WIN32_PFD
INTRINSIC
: 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_FBCONFIG
INTRINSIC
: Win32 PIXELFORMATDESCRIPTOR IDNATIVE
: Win32 PIXELFORMATDESCRIPTOR IDWIN32_PFD
: Win32 PIXELFORMATDESCRIPTOR ID
- EGL/GL throws NativeWindowException on
X11_XVISUAL
,X11_FBCONFIG
,WIN32_PFD
INTRINSIC
: EGL Config IDNATIVE
: EGL NativeVisual ID (X11 XVisual ID, Win32 PIXELFORMATDESCRIPTOR ID, ...)EGL_CONFIG
: EGL Config ID
One may use
Note:VisualIDHolder.isVisualIDSupported(VIDType)
to test upfront whether aVisualIDHolder.VIDType
is supported, e.g. to avoid an exception or query or compare all available.INTRINSIC
andNATIVE
are 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:
getVisualID
in interfaceVisualIDHolder
- Throws:
NativeWindowException
- iftype
is neitherINTRINSIC
norNATIVE
and does not match the native implementation.- See Also:
VisualIDHolder.isVisualIDSupported(VIDType)
- X11 throws NativeWindowException on
-
isVisualIDSupported
public final boolean isVisualIDSupported(VisualIDHolder.VIDType type)
Description copied from interface:VisualIDHolder
Returns true if the givenVisualIDHolder.VIDType
is supported, otherwise false.Note:
INTRINSIC
andNATIVE
are 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:
isVisualIDSupported
in interfaceVisualIDHolder
- See Also:
VisualIDHolder.getVisualID(VIDType)
-
toHexString
public static String toHexString(int val)
-
toHexString
public static String toHexString(long val)
-
-