Package com.jogamp.nativewindow.egl
Class EGLGraphicsDevice
java.lang.Object
com.jogamp.nativewindow.DefaultGraphicsDevice
com.jogamp.nativewindow.egl.EGLGraphicsDevice
- All Implemented Interfaces:
AbstractGraphicsDevice,Cloneable
Encapsulates a graphics device on EGL platforms.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceHack to allow inject a EGL termination call. -
Field Summary
Fields inherited from interface com.jogamp.nativewindow.AbstractGraphicsDevice
DEBUG, DEFAULT_CONNECTION, DEFAULT_UNIT, EXTERNAL_CONNECTION -
Constructor Summary
ConstructorsConstructorDescriptionNote that this is not an open connection, ie no native display handle exist.EGLGraphicsDevice(long nativeDisplayID, long eglDisplay, String connection, int unitID, EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback) EGLGraphicsDevice(AbstractGraphicsDevice aDevice, long eglDisplay, EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback) -
Method Summary
Modifier and TypeMethodDescriptionvoidclone()booleanclose()Closes the EGL device if handle is not null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallbackis valid.com.jogamp.common.util.VersionNumberEGL server version as returned byeglInitialize(..).longbooleanbooleanopen()Opens the EGL device if handle is null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallbackis valid.toString()Methods inherited from class com.jogamp.nativewindow.DefaultGraphicsDevice
getConnection, getDefaultDisplayConnection, getDefaultDisplayConnection, getHandle, getToolkitLock, getType, getUniqueID, getUnitID, lock, swapDeviceHandleAndOwnership, unlock, validateLocked
-
Constructor Details
-
EGLGraphicsDevice
public EGLGraphicsDevice()Note that this is not an open connection, ie no native display handle exist. This constructor exist to setup a default device connection/unit. -
EGLGraphicsDevice
public EGLGraphicsDevice(AbstractGraphicsDevice aDevice, long eglDisplay, EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback) -
EGLGraphicsDevice
public EGLGraphicsDevice(long nativeDisplayID, long eglDisplay, String connection, int unitID, EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback)
-
-
Method Details
-
getEGLVersion
public com.jogamp.common.util.VersionNumber getEGLVersion()EGL server version as returned byeglInitialize(..). Only valid afteropen(). -
getNativeDisplayID
public long getNativeDisplayID() -
clone
- Specified by:
clonein interfaceAbstractGraphicsDevice- Overrides:
clonein classDefaultGraphicsDevice
-
open
public boolean open()Opens the EGL device if handle is null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallbackis valid.Optionally [re]opening the device if handle is
null.The default implementation is a
NOP.Example implementations like
X11GraphicsDeviceorEGLGraphicsDeviceissue the native open operation in case handle isnull.- Specified by:
openin interfaceAbstractGraphicsDevice- Overrides:
openin classDefaultGraphicsDevice- Returns:
- true if the handle was
nulland opening was successful, otherwise false.
-
close
public boolean close()Closes the EGL device if handle is not null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallbackis valid.Optionally closing the device if handle is not
null.The default implementation
disposeit'sToolkitLockand sets the handle tonull.Example implementations like
X11GraphicsDeviceorEGLGraphicsDeviceissue the native close operation or skip it depending on thehandles's ownership.- Specified by:
closein interfaceAbstractGraphicsDevice- Overrides:
closein classDefaultGraphicsDevice- Returns:
- true if the handle was not
nulland closing was successful, otherwise false.
-
isHandleOwner
public boolean isHandleOwner()- Specified by:
isHandleOwnerin interfaceAbstractGraphicsDevice- Overrides:
isHandleOwnerin classDefaultGraphicsDevice- Returns:
trueif instance owns the handle to issueAbstractGraphicsDevice.close(), otherwisefalse.
-
clearHandleOwner
public void clearHandleOwner()- Specified by:
clearHandleOwnerin interfaceAbstractGraphicsDevice- Overrides:
clearHandleOwnerin classDefaultGraphicsDevice
-
toString
- Overrides:
toStringin classDefaultGraphicsDevice
-