JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.nativewindow.egl.EGLGraphicsDevice Class Reference

Encapsulates a graphics device on EGL platforms. More...

Inheritance diagram for com.jogamp.nativewindow.egl.EGLGraphicsDevice:
Collaboration diagram for com.jogamp.nativewindow.egl.EGLGraphicsDevice:

Classes

interface  EGLDisplayLifecycleCallback
 Hack to allow inject a EGL termination call. More...
 

Public Member Functions

 EGLGraphicsDevice ()
 Constructs a dummy EGLGraphicsDevice with default connection settings. More...
 
 EGLGraphicsDevice (final long nativeDisplayID, final String connection, final int unitID)
 Constructs a new dummy EGLGraphicsDevice reusing the given native display connection with a EGL#EGL_NO_DISPLAY EGL display handle. More...
 
 EGLGraphicsDevice (final long nativeDisplayID, final long eglDisplay, final String connection, final int unitID)
 Constructs a new EGLGraphicsDevice reusing the given native display connection and handle. More...
 
 EGLGraphicsDevice (final AbstractGraphicsDevice aDevice, final EGLDisplayLifecycleCallback eglLifecycleCallback)
 Constructs a new EGLGraphicsDevice using AbstractGraphicsDevice's native display ID and connection, using the EGLDisplayLifecycleCallback to handle this instance's native EGL lifecycle. More...
 
 EGLGraphicsDevice (final long nativeDisplayID, final String connection, final int unitID, final EGLDisplayLifecycleCallback eglLifecycleCallback)
 Constructs a new EGLGraphicsDevice using AbstractGraphicsDevice's native display ID and connection, using the EGLDisplayLifecycleCallback to handle this instance's native EGL lifecycle. More...
 
VersionNumber getEGLVersion ()
 EGL server version as returned by eglInitialize(..). More...
 
long getNativeDisplayID ()
 Return the native display ID of this instance. More...
 
boolean sameNativeDisplayID (final AbstractGraphicsDevice aDevice)
 Returns true if given AbstractGraphicsDevice uses the same getNativeDisplayID() of this instance. More...
 
Object clone ()
 
boolean open ()
 Opens the EGL device if handle is null and it's EGLDisplayLifecycleCallback is valid. More...
 
boolean close ()
 Closes the EGL device if handle is not null and it's EGLDisplayLifecycleCallback is valid. More...
 
String toString ()
 
- Public Member Functions inherited from com.jogamp.nativewindow.DefaultGraphicsDevice
 DefaultGraphicsDevice (final String type, final String connection, final int unitID)
 Create an instance with the system default ToolkitLock, gathered via NativeWindowFactory#getDefaultToolkitLock(String). More...
 
 DefaultGraphicsDevice (final String type, final String connection, final int unitID, final long handle)
 Create an instance with the system default ToolkitLock. More...
 
 DefaultGraphicsDevice (final String type, final String connection, final int unitID, final long handle, final ToolkitLock locker)
 Create an instance with the given ToolkitLock instance, or null ToolkitLock if null. More...
 
Object clone ()
 
final String getType ()
 Returns the type of the underlying subsystem, ie NativeWindowFactory.TYPE_KD, NativeWindowFactory.TYPE_X11, . More...
 
final String getConnection ()
 Returns the semantic GraphicsDevice connection. More...
 
final int getUnitID ()
 Returns the graphics device unit ID. More...
 
final String getUniqueID ()
 Returns a unique ID object of this device using type, connection and unitID as it's key components. More...
 
final long getHandle ()
 Returns the native handle of the underlying native device, if such thing exist. More...
 
final void lock ()
 Optionally locking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#lock().The lock implementation must be recursive. More...
 
final void validateLocked () throws RuntimeException
 
final void unlock ()
 Optionally unlocking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#unlock().The lock implementation must be recursive.
Exceptions
RuntimeExceptionin case the lock is not acquired by this thread.
More...
 
boolean open ()
 Optionally [re]opening the device if handle is null. More...
 
boolean close ()
 Optionally closing the device if handle is not null. More...
 
final boolean isHandleOwner ()
 
final void clearHandleOwner ()
 
String toString ()
 
final ToolkitLock getToolkitLock ()
 
Object clone ()
 
String getType ()
 Returns the type of the underlying subsystem, ie NativeWindowFactory.TYPE_KD, NativeWindowFactory.TYPE_X11, . More...
 
String getConnection ()
 Returns the semantic GraphicsDevice connection. More...
 
int getUnitID ()
 Returns the graphics device unit ID. More...
 
String getUniqueID ()
 Returns a unique ID object of this device using type, connection and unitID as it's key components. More...
 
long getHandle ()
 Returns the native handle of the underlying native device, if such thing exist. More...
 
void lock ()
 Optionally locking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#lock(). More...
 
void unlock ()
 Optionally unlocking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#unlock(). More...
 
void validateLocked () throws RuntimeException
 
boolean open ()
 Optionally [re]opening the device if handle is null. More...
 
boolean close ()
 Optionally closing the device if handle is not null. More...
 
boolean isHandleOwner ()
 
void clearHandleOwner ()
 

Static Public Member Functions

static long getNativeDisplayID (final AbstractGraphicsDevice aDevice)
 Returns the native display ID of the given abstract device, i.e. More...
 
- Static Public Member Functions inherited from com.jogamp.nativewindow.DefaultGraphicsDevice
static String getDefaultDisplayConnection ()
 Return the default display connection for the given windowing toolkit type gathered via NativeWindowFactory#getDefaultDisplayConnection(). More...
 
static String getDefaultDisplayConnection (final String type)
 Return the default display connection for the given windowing toolkit type gathered via NativeWindowFactory#getDefaultDisplayConnection(String). More...
 
static final void swapHandleAndOwnership (final DefaultGraphicsDevice a, final DefaultGraphicsDevice b)
 

Static Public Attributes

static final int EGL_DEFAULT_DISPLAY = 0
 EGL default native display ID. More...
 
static final int EGL_NO_DISPLAY = 0
 EGL no display handle. More...
 
- Static Public Attributes inherited from com.jogamp.nativewindow.AbstractGraphicsDevice
static final boolean DEBUG = Debug.debug("GraphicsDevice")
 
static String DEFAULT_CONNECTION = "decon"
 Dummy connection value for a default connection where no native support for multiple devices is available. More...
 
static String EXTERNAL_CONNECTION = "excon"
 Dummy connection value for an external connection where no native support for multiple devices is available. More...
 
static int DEFAULT_UNIT = 0
 Default unit id for the 1st device: 0. More...
 

Additional Inherited Members

- Protected Member Functions inherited from com.jogamp.nativewindow.DefaultGraphicsDevice
final long setHandle (final long newHandle)
 Set the native handle of the underlying native device and return the previous one. More...
 
final Object getHandleOwnership ()
 
final Object setHandleOwnership (final Object newOwnership)
 
ToolkitLock setToolkitLock (final ToolkitLock locker)
 Set the internal ToolkitLock, which is used within the lock() and unlock() implementation. More...
 
- Protected Attributes inherited from com.jogamp.nativewindow.DefaultGraphicsDevice
final String connection
 
final int unitID
 
final String uniqueID
 
long handle
 
ToolkitLock toolkitLock
 

Detailed Description

Encapsulates a graphics device on EGL platforms.

Definition at line 45 of file EGLGraphicsDevice.java.

Constructor & Destructor Documentation

◆ EGLGraphicsDevice() [1/5]

com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLGraphicsDevice ( )

Constructs a dummy EGLGraphicsDevice with default connection settings.

The constructed instance will never create a valid EGL display handle.

Definition at line 113 of file EGLGraphicsDevice.java.

Here is the call graph for this function:

◆ EGLGraphicsDevice() [2/5]

com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLGraphicsDevice ( final long  nativeDisplayID,
final String  connection,
final int  unitID 
)

Constructs a new dummy EGLGraphicsDevice reusing the given native display connection with a EGL#EGL_NO_DISPLAY EGL display handle.

The constructed instance will never create a valid EGL display handle.

Parameters
nativeDisplayIDthe existing native display ID
eglDisplaythe existing EGL handle to this nativeDisplayID
connectionthe existing underlying native connection name
unitIDthe unit ID

Definition at line 128 of file EGLGraphicsDevice.java.

◆ EGLGraphicsDevice() [3/5]

com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLGraphicsDevice ( final long  nativeDisplayID,
final long  eglDisplay,
final String  connection,
final int  unitID 
)

Constructs a new EGLGraphicsDevice reusing the given native display connection and handle.

The constructed instance will not take ownership of given EGL display handle.

Parameters
nativeDisplayIDthe existing native display ID
eglDisplaythe existing EGL handle to this nativeDisplayID
connectionthe existing underlying native connection name
unitIDthe unit ID

Definition at line 142 of file EGLGraphicsDevice.java.

◆ EGLGraphicsDevice() [4/5]

com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLGraphicsDevice ( final AbstractGraphicsDevice  aDevice,
final EGLDisplayLifecycleCallback  eglLifecycleCallback 
)

Constructs a new EGLGraphicsDevice using AbstractGraphicsDevice's native display ID and connection, using the EGLDisplayLifecycleCallback to handle this instance's native EGL lifecycle.

The constructed instance will take ownership of the created EGL display handle.

Parameters
aDevicevalid AbstractGraphicsDevice's native display ID, connection and unitID
eglLifecycleCallbackvalid EGLDisplayLifecycleCallback to handle this instance's native EGL lifecycle.

Definition at line 158 of file EGLGraphicsDevice.java.

Here is the call graph for this function:

◆ EGLGraphicsDevice() [5/5]

com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLGraphicsDevice ( final long  nativeDisplayID,
final String  connection,
final int  unitID,
final EGLDisplayLifecycleCallback  eglLifecycleCallback 
)

Constructs a new EGLGraphicsDevice using AbstractGraphicsDevice's native display ID and connection, using the EGLDisplayLifecycleCallback to handle this instance's native EGL lifecycle.

The constructed instance will take ownership of the created EGL display handle.

Parameters
nativeDisplayIDthe existing native display ID
connectionthe existing underlying native connection name
unitIDthe unit ID
eglLifecycleCallbackvalid EGLDisplayLifecycleCallback to handle this instance's native EGL lifecycle.

Definition at line 176 of file EGLGraphicsDevice.java.

Member Function Documentation

◆ clone()

Object com.jogamp.nativewindow.egl.EGLGraphicsDevice.clone ( )

Reimplemented from com.jogamp.nativewindow.DefaultGraphicsDevice.

Definition at line 209 of file EGLGraphicsDevice.java.

◆ close()

boolean com.jogamp.nativewindow.egl.EGLGraphicsDevice.close ( )

Closes the EGL device if handle is not null and it's EGLDisplayLifecycleCallback is valid.

Optionally closing the device if handle is not null.The default implementation dispose it's ToolkitLock and sets the handle to null. Example implementations like com.jogamp.nativewindow.x11.X11GraphicsDevice or com.jogamp.nativewindow.egl.EGLGraphicsDevice issue the native close operation or skip it depending on the handles's ownership.

Returns
true if the handle was not null and closing was successful, otherwise false.

Reimplemented from com.jogamp.nativewindow.DefaultGraphicsDevice.

Definition at line 246 of file EGLGraphicsDevice.java.

Here is the call graph for this function:

◆ getEGLVersion()

VersionNumber com.jogamp.nativewindow.egl.EGLGraphicsDevice.getEGLVersion ( )

EGL server version as returned by eglInitialize(..).

Only valid after open().

Definition at line 184 of file EGLGraphicsDevice.java.

◆ getNativeDisplayID() [1/2]

long com.jogamp.nativewindow.egl.EGLGraphicsDevice.getNativeDisplayID ( )

Return the native display ID of this instance.

Since EGL 1.4, sharing resources requires e.g. a GLContext to use the same native display ID for the so called shared context list and the to be created context.

See also
getNativeDisplayID(AbstractGraphicsDevice)

Definition at line 194 of file EGLGraphicsDevice.java.

Here is the caller graph for this function:

◆ getNativeDisplayID() [2/2]

static long com.jogamp.nativewindow.egl.EGLGraphicsDevice.getNativeDisplayID ( final AbstractGraphicsDevice  aDevice)
static

Returns the native display ID of the given abstract device, i.e.

either EGLGraphicsDevice#getNativeDisplayID() or AbstractGraphicsDevice#getHandle().

Definition at line 83 of file EGLGraphicsDevice.java.

Here is the call graph for this function:

◆ open()

boolean com.jogamp.nativewindow.egl.EGLGraphicsDevice.open ( )

Opens the EGL device if handle is null and it's EGLDisplayLifecycleCallback is valid.

Optionally [re]opening the device if handle is null.The default implementation is a NOP. Example implementations like com.jogamp.nativewindow.x11.X11GraphicsDevice or com.jogamp.nativewindow.egl.EGLGraphicsDevice issue the native open operation in case handle is null.

Returns
true if the handle was null and opening was successful, otherwise false.

Reimplemented from com.jogamp.nativewindow.DefaultGraphicsDevice.

Definition at line 220 of file EGLGraphicsDevice.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sameNativeDisplayID()

boolean com.jogamp.nativewindow.egl.EGLGraphicsDevice.sameNativeDisplayID ( final AbstractGraphicsDevice  aDevice)

Returns true if given AbstractGraphicsDevice uses the same getNativeDisplayID() of this instance.

In case given AbstractGraphicsDevice is not a EGLGraphicsDevice, its AbstractGraphicsDevice#getHandle() is being used as the native display id for a matching EGLGraphicsDevice instance.

See also
getNativeDisplayID(AbstractGraphicsDevice)

Definition at line 204 of file EGLGraphicsDevice.java.

Here is the call graph for this function:

◆ toString()

String com.jogamp.nativewindow.egl.EGLGraphicsDevice.toString ( )

Reimplemented from com.jogamp.nativewindow.DefaultGraphicsDevice.

Definition at line 261 of file EGLGraphicsDevice.java.

Here is the call graph for this function:

Member Data Documentation

◆ EGL_DEFAULT_DISPLAY

final int com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGL_DEFAULT_DISPLAY = 0
static

EGL default native display ID.

Definition at line 47 of file EGLGraphicsDevice.java.

◆ EGL_NO_DISPLAY

final int com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGL_NO_DISPLAY = 0
static

EGL no display handle.

Definition at line 49 of file EGLGraphicsDevice.java.


The documentation for this class was generated from the following file: