|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
Provides a pluggable mechanism for arbitrary window toolkits to adapt their components to the NativeWindow interface, which provides a platform-independent mechanism of accessing the information required to perform operations like hardware-accelerated rendering using the OpenGL API.
More...
Static Public Member Functions | |
| static final boolean | isJVMShuttingDown () |
| Returns true if the JVM is shutting down, otherwise false. More... | |
| static void | addCustomShutdownHook (final boolean head, final Runnable runnable) |
| Add a custom shutdown hook to be performed at JVM shutdown before shutting down NativeWindowFactory instance. More... | |
| static synchronized void | shutdown (final boolean _isJVMShuttingDown) |
| Cleanup resources at JVM shutdown. More... | |
| static synchronized boolean | isInitialized () |
Returns true if initSingleton() has been called w/o subsequent shutdown(boolean). More... | |
| static synchronized void | initSingleton () |
| Static one time initialization of this factory. More... | |
| static boolean | requiresToolkitLock () |
| static boolean | isAWTAvailable () |
| static String | getNativeWindowType (final boolean useCustom) |
| static void | setDefaultFactory (final NativeWindowFactory factory) |
| Don't know if we shall add this factory here . More... | |
| static NativeWindowFactory | getDefaultFactory () |
| Gets the default NativeWindowFactory. More... | |
| static ToolkitLock | getAWTToolkitLock () |
Returns the AWT ToolkitLock (JAWT based) if isAWTAvailable, otherwise null. More... | |
| static ToolkitLock | getNullToolkitLock () |
| static ToolkitLock | getDefaultToolkitLock () |
Provides the system default ToolkitLock for the default system windowing type. More... | |
| static ToolkitLock | getDefaultToolkitLock (final String type) |
Provides the default ToolkitLock for type. More... | |
| static AbstractGraphicsScreen | createScreen (final AbstractGraphicsDevice device, int screen) |
| static NativeWindowFactory | getFactory (final Class<?> windowClass) throws IllegalArgumentException |
| Returns the appropriate NativeWindowFactory to handle window objects of the given type. More... | |
| static NativeWindow | getNativeWindow (final Object winObj, final AbstractGraphicsConfiguration config) throws IllegalArgumentException, NativeWindowException |
Converts the given window object and it's AbstractGraphicsConfiguration into a NativeWindow which can be operated upon by a custom toolkit, e.g. More... | |
| static OffscreenLayerSurface | getOffscreenLayerSurface (final NativeSurface surface, final boolean ifEnabled) |
Returns the OffscreenLayerSurface instance of this NativeSurface. More... | |
| static boolean | isNativeVisualIDValidForProcessing (final int visualID) |
| Returns true if the given visualID is valid for further processing, i.e. More... | |
| static String | getDefaultDisplayConnection () |
| static String | getDefaultDisplayConnection (final String nwt) |
| static AbstractGraphicsDevice | createDevice (final String displayConnection, final boolean own) |
Creates a native device type, following getNativeWindowType(true). More... | |
| static AbstractGraphicsDevice | createDevice (final String nwt, final String displayConnection, final boolean own) |
Creates a native device type, following the given native-window-type. More... | |
| static AbstractGraphicsDevice | createDevice (final String nwt, final String displayConnection, final int unitID, final boolean own) |
Creates a native device type, following the given native-window-type. More... | |
| static NativeWindow | createWrappedWindow (final AbstractGraphicsScreen aScreen, final long surfaceHandle, final long windowHandle, final UpstreamWindowHookMutableSizePos hook) |
Creates a wrapped NativeWindow with given native handles and AbstractGraphicsScreen. More... | |
| static Point | getLocationOnScreen (final NativeWindow nw) |
Static Public Attributes | |
| static final String | TYPE_WAYLAND = ".wayland" |
Wayland/EGL type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_DRM_GBM = ".egl.gbm" |
DRM/GBM type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_EGL = ".egl" |
OpenKODE/EGL type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_WINDOWS = ".windows" |
Microsoft Windows type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_X11 = ".x11" |
X11 type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_BCM_VC_IV = ".bcm.vc.iv" |
Broadcom VC IV/EGL type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_ANDROID = ".android" |
Android/EGL type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_MACOSX = ".macosx" |
Mac OS X type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_IOS = ".ios" |
iOS type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_AWT = ".awt" |
Generic AWT type, as retrieved with getNativeWindowType(boolean). More... | |
| static final String | TYPE_DEFAULT = ".default" |
Generic DEFAULT type, where platform implementation don't care, as retrieved with getNativeWindowType(boolean). More... | |
Protected Member Functions | |
| NativeWindowFactory () | |
| Creates a new NativeWindowFactory instance. More... | |
| abstract NativeWindow | getNativeWindowImpl (Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException |
| Performs the conversion from a toolkit's window object to a NativeWindow. More... | |
Static Protected Member Functions | |
| static void | registerFactory (final Class<?> windowClass, final NativeWindowFactory factory) |
| Registers a NativeWindowFactory handling window objects of the given class. More... | |
Static Protected Attributes | |
| static final boolean | DEBUG |
Provides a pluggable mechanism for arbitrary window toolkits to adapt their components to the NativeWindow interface, which provides a platform-independent mechanism of accessing the information required to perform operations like hardware-accelerated rendering using the OpenGL API.
FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
Definition at line 70 of file NativeWindowFactory.java.
|
protected |
Creates a new NativeWindowFactory instance.
End users do not need to call this method.
Definition at line 138 of file NativeWindowFactory.java.
|
static |
Add a custom shutdown hook to be performed at JVM shutdown before shutting down NativeWindowFactory instance.
| head | if true add runnable at the start, otherwise at the end |
| runnable | runnable to be added. |
Definition at line 302 of file NativeWindowFactory.java.
|
static |
Creates a native device type, following getNativeWindowType(true).
The device will be opened if own is true, otherwise no native handle will ever be acquired.
Definition at line 700 of file NativeWindowFactory.java.
|
static |
Creates a native device type, following the given native-window-type.
The device will be opened if own is true, otherwise no native handle will ever be acquired.
FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
Definition at line 713 of file NativeWindowFactory.java.
|
static |
Creates a native device type, following the given native-window-type.
The device will be opened if own is true, otherwise no native handle will ever be acquired.
FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
Definition at line 726 of file NativeWindowFactory.java.
|
static |
| device | |
| screen | -1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen |
Definition at line 549 of file NativeWindowFactory.java.
|
static |
Creates a wrapped NativeWindow with given native handles and AbstractGraphicsScreen.
The given UpstreamWindowHookMutableSizePos maybe used to reflect resizes and repositioning of the native window.
The AbstractGraphicsScreen may be created via createScreen(AbstractGraphicsDevice, int).
The AbstractGraphicsScreen may have an underlying open AbstractGraphicsDevice or a simple dummy instance, see createDevice(String, boolean).
Definition at line 782 of file NativeWindowFactory.java.
|
static |
Returns the AWT ToolkitLock (JAWT based) if isAWTAvailable, otherwise null.
The JAWT based ToolkitLock also locks the global lock, which matters if the latter is required.
Definition at line 509 of file NativeWindowFactory.java.
|
static |
Definition at line 683 of file NativeWindowFactory.java.
|
static |
Definition at line 686 of file NativeWindowFactory.java.
|
static |
Gets the default NativeWindowFactory.
Definition at line 498 of file NativeWindowFactory.java.
|
static |
Provides the system default ToolkitLock for the default system windowing type.
Definition at line 522 of file NativeWindowFactory.java.
|
static |
Provides the default ToolkitLock for type.
ToolkitLock if required and type is of TYPE_AWT and AWT available, jogamp.nativewindow.ResourceToolkitLock if required, otherwise jogamp.nativewindow.NullToolkitLock Definition at line 534 of file NativeWindowFactory.java.
|
static |
Returns the appropriate NativeWindowFactory to handle window objects of the given type.
The windowClass might be NativeWindow, in which case the client has already assumed the responsibility of creating a compatible NativeWindow implementation, or it might be that of a toolkit class like Component.
Definition at line 574 of file NativeWindowFactory.java.
|
static |
| nw |
FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
Definition at line 796 of file NativeWindowFactory.java.
|
static |
Converts the given window object and it's AbstractGraphicsConfiguration into a NativeWindow which can be operated upon by a custom toolkit, e.g.
com.jogamp.opengl.GLDrawableFactory.
The object may be a component for a particular window toolkit, such as an AWT Canvas. It may also be a NativeWindow object itself.
You shall utilize GraphicsConfigurationFactory to construct a proper AbstractGraphicsConfiguration.
The particular implementation of the NativeWindowFactory is responsible for handling objects from a particular window toolkit. The built-in NativeWindowFactory handles NativeWindow instances as well as AWT Components.
| IllegalArgumentException | if the given window object could not be handled by any of the registered NativeWindowFactory instances |
Definition at line 618 of file NativeWindowFactory.java.
|
abstractprotected |
Performs the conversion from a toolkit's window object to a NativeWindow.
Implementors of concrete NativeWindowFactory subclasses should override this method.
|
static |
| useCustom | if false return the native value, if true return a custom value if set, otherwise fallback to the native value. |
TYPE_X11, which is canonical via String#intern(). Hence String#equals(Object) and == produce the same result. Definition at line 473 of file NativeWindowFactory.java.
|
static |
Definition at line 513 of file NativeWindowFactory.java.
|
static |
Returns the OffscreenLayerSurface instance of this NativeSurface.
In case this surface is a NativeWindow, we traverse from the given surface up to root until an implementation of OffscreenLayerSurface is found. In case ifEnabled is true, the surface must also implement OffscreenLayerOption where OffscreenLayerOption#isOffscreenLayerSurfaceEnabled() is true.
| surface | The surface to query. |
| ifEnabled | If true, only return the enabled OffscreenLayerSurface, see OffscreenLayerOption#isOffscreenLayerSurfaceEnabled(). |
Definition at line 644 of file NativeWindowFactory.java.
|
static |
Static one time initialization of this factory.
This initialization method must be called once by the program or utilizing modules!
Definition at line 373 of file NativeWindowFactory.java.
|
static |
Definition at line 466 of file NativeWindowFactory.java.
|
static |
Returns true if initSingleton() has been called w/o subsequent shutdown(boolean).
Definition at line 367 of file NativeWindowFactory.java.
|
static |
Returns true if the JVM is shutting down, otherwise false.
Definition at line 294 of file NativeWindowFactory.java.
|
static |
Returns true if the given visualID is valid for further processing, i.e.
OpenGL usage, otherwise return false.
On certain platforms, i.e. X11, a valid visualID is required at window creation. Other platforms may determine it later on, e.g. OSX and Windows.
If the visualID is VisualIDHolder#VID_UNDEFINED and the platform requires it at creation time (see above), it is not valid for further processing.
FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
Definition at line 678 of file NativeWindowFactory.java.
|
staticprotected |
Registers a NativeWindowFactory handling window objects of the given class.
This does not need to be called by end users, only implementors of new NativeWindowFactory subclasses.
Definition at line 592 of file NativeWindowFactory.java.
|
static |
Definition at line 461 of file NativeWindowFactory.java.
|
static |
Don't know if we shall add this factory here .
FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
public static AbstractGraphicsDevice createGraphicsDevice(String type, String connection, int unitID, long handle, ToolkitLock locker) { if(TYPE_EGL == type) { return new } else if(TYPE_X11 == type) { } else if(TYPE_WINDOWS == type) { } else if(TYPE_MACOSX == type)) { } else if(TYPE_AWT == type) { } else if(TYPE_DEFAULT == type) { } } Sets the default NativeWindowFactory.
Definition at line 493 of file NativeWindowFactory.java.
|
static |
Cleanup resources at JVM shutdown.
Definition at line 317 of file NativeWindowFactory.java.
|
staticprotected |
Definition at line 71 of file NativeWindowFactory.java.
|
static |
Android/EGL type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 92 of file NativeWindowFactory.java.
|
static |
Generic AWT type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 101 of file NativeWindowFactory.java.
|
static |
Broadcom VC IV/EGL type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 89 of file NativeWindowFactory.java.
|
static |
Generic DEFAULT type, where platform implementation don't care, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 104 of file NativeWindowFactory.java.
|
static |
DRM/GBM type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 77 of file NativeWindowFactory.java.
|
static |
OpenKODE/EGL type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 80 of file NativeWindowFactory.java.
|
static |
iOS type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 98 of file NativeWindowFactory.java.
|
static |
Mac OS X type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 95 of file NativeWindowFactory.java.
|
static |
Wayland/EGL type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 74 of file NativeWindowFactory.java.
|
static |
Microsoft Windows type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 83 of file NativeWindowFactory.java.
|
static |
X11 type, as retrieved with getNativeWindowType(boolean).
String is canonical via String#intern().
Definition at line 86 of file NativeWindowFactory.java.