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 interface
EGLGraphicsDevice.EGLDisplayLifecycleCallback
Hack 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 void
clearHandleOwner()
Object
clone()
boolean
close()
Closes the EGL device if handle is not null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallback
is valid.VersionNumber
getEGLVersion()
EGL server version as returned byeglInitialize(..)
.long
getNativeDisplayID()
boolean
isHandleOwner()
boolean
open()
Opens the EGL device if handle is null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallback
is valid.String
toString()
-
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:
clone
in interfaceAbstractGraphicsDevice
- Overrides:
clone
in classDefaultGraphicsDevice
-
open
public boolean open()
Opens the EGL device if handle is null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallback
is valid.Optionally [re]opening the device if handle is
null
.The default implementation is a
NOP
.Example implementations like
X11GraphicsDevice
orEGLGraphicsDevice
issue the native open operation in case handle isnull
.- Specified by:
open
in interfaceAbstractGraphicsDevice
- Overrides:
open
in classDefaultGraphicsDevice
- Returns:
- true if the handle was
null
and opening was successful, otherwise false.
-
close
public boolean close()
Closes the EGL device if handle is not null and it'sEGLGraphicsDevice.EGLDisplayLifecycleCallback
is valid.Optionally closing the device if handle is not
null
.The default implementation
dispose
it'sToolkitLock
and sets the handle tonull
.Example implementations like
X11GraphicsDevice
orEGLGraphicsDevice
issue the native close operation or skip it depending on thehandles's ownership
.- Specified by:
close
in interfaceAbstractGraphicsDevice
- Overrides:
close
in classDefaultGraphicsDevice
- Returns:
- true if the handle was not
null
and closing was successful, otherwise false.
-
isHandleOwner
public boolean isHandleOwner()
- Specified by:
isHandleOwner
in interfaceAbstractGraphicsDevice
- Overrides:
isHandleOwner
in classDefaultGraphicsDevice
- Returns:
true
if instance owns the handle to issueAbstractGraphicsDevice.close()
, otherwisefalse
.
-
clearHandleOwner
public void clearHandleOwner()
- Specified by:
clearHandleOwner
in interfaceAbstractGraphicsDevice
- Overrides:
clearHandleOwner
in classDefaultGraphicsDevice
-
toString
public String toString()
- Overrides:
toString
in classDefaultGraphicsDevice
-
-