Package com.jogamp.nativewindow.egl
Class EGLGraphicsDevice
- java.lang.Object
-
- com.jogamp.nativewindow.DefaultGraphicsDevice
-
- com.jogamp.nativewindow.egl.EGLGraphicsDevice
-
- All Implemented Interfaces:
AbstractGraphicsDevice,Cloneable
public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneable
Encapsulates a graphics device on EGL platforms.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEGLGraphicsDevice.EGLDisplayLifecycleCallbackHack 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
Constructors Constructor Description EGLGraphicsDevice()Note 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearHandleOwner()Objectclone()booleanclose()Closes the EGL device if handle is not null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallbackis valid.VersionNumbergetEGLVersion()EGL server version as returned byeglInitialize(..).longgetNativeDisplayID()booleanisHandleOwner()booleanopen()Opens the EGL device if handle is null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallbackis valid.StringtoString()-
Methods inherited from class com.jogamp.nativewindow.DefaultGraphicsDevice
getConnection, getDefaultDisplayConnection, getDefaultDisplayConnection, getHandle, getToolkitLock, getType, getUniqueID, getUnitID, lock, swapDeviceHandleAndOwnership, unlock, validateLocked
-
-
-
-
Constructor Detail
-
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 Detail
-
getEGLVersion
public VersionNumber getEGLVersion()
EGL server version as returned byeglInitialize(..). Only valid afteropen().
-
getNativeDisplayID
public long getNativeDisplayID()
-
clone
public Object 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
public String toString()
- Overrides:
toStringin classDefaultGraphicsDevice
-
-