34package com.jogamp.nativewindow.egl;
36import com.jogamp.common.util.VersionNumber;
37import com.jogamp.nativewindow.AbstractGraphicsDevice;
38import com.jogamp.nativewindow.DefaultGraphicsDevice;
39import com.jogamp.nativewindow.NativeWindowException;
40import com.jogamp.nativewindow.NativeWindowFactory;
51 private final long[] nativeDisplayID =
new long[1];
52 private VersionNumber eglVersion = VersionNumber.zeroVersion;
100 final EGLDisplayLifecycleCallback eglLifecycleCallback)
103 this.nativeDisplayID[0] = nativeDisplayID;
160 if (
null == eglLifecycleCallback) {
178 if (
null == eglLifecycleCallback) {
210 return super.clone();
223 System.err.println(Thread.currentThread().getName() +
" - EGLGraphicsDevice.open(): "+
this);
225 final int[] major = { 0 };
226 final int[] minor = { 0 };
229 eglVersion = VersionNumber.zeroVersion;
232 eglVersion =
new VersionNumber(major[0], minor[0], 0);
249 System.err.println(Thread.currentThread().getName() +
" - EGLGraphicsDevice.close(): "+
this);
253 return super.close();
256 private EGLDisplayLifecycleCallback getEGLLifecycleCallback() {
final String getType()
Returns the type of the underlying subsystem, ie NativeWindowFactory.TYPE_KD, NativeWindowFactory....
final int getUnitID()
Returns the graphics device unit ID.
final String getConnection()
Returns the semantic GraphicsDevice connection.
final long getHandle()
Returns the native handle of the underlying native device, if such thing exist.
final Object getHandleOwnership()
static String getDefaultDisplayConnection()
Return the default display connection for the given windowing toolkit type gathered via NativeWindowF...
final Object setHandleOwnership(final Object newOwnership)
final boolean isHandleOwner()
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Provides a pluggable mechanism for arbitrary window toolkits to adapt their components to the NativeW...
static final String TYPE_EGL
OpenKODE/EGL type, as retrieved with getNativeWindowType(boolean).
Encapsulates a graphics device on EGL platforms.
EGLGraphicsDevice()
Constructs a dummy EGLGraphicsDevice with default connection settings.
static final int EGL_DEFAULT_DISPLAY
EGL default native display ID.
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.
boolean sameNativeDisplayID(final AbstractGraphicsDevice aDevice)
Returns true if given AbstractGraphicsDevice uses the same getNativeDisplayID() of this instance.
VersionNumber getEGLVersion()
EGL server version as returned by eglInitialize(..).
boolean open()
Opens the EGL device if handle is null and it's EGLDisplayLifecycleCallback is valid.
long getNativeDisplayID()
Return the native display ID of this instance.
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_N...
static final int EGL_NO_DISPLAY
EGL no display handle.
static long getNativeDisplayID(final AbstractGraphicsDevice aDevice)
Returns the native display ID of the given abstract device, i.e.
boolean close()
Closes the EGL device if handle is not null and it's EGLDisplayLifecycleCallback is valid.
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,...
EGLGraphicsDevice(final AbstractGraphicsDevice aDevice, final EGLDisplayLifecycleCallback eglLifecycleCallback)
Constructs a new EGLGraphicsDevice using AbstractGraphicsDevice's native display ID and connection,...
A interface describing a graphics device in a toolkit-independent manner.
long getHandle()
Returns the native handle of the underlying native device, if such thing exist.
static final boolean DEBUG
int getUnitID()
Returns the graphics device unit ID.
static int DEFAULT_UNIT
Default unit id for the 1st device: 0.
String getConnection()
Returns the semantic GraphicsDevice connection.
Hack to allow inject a EGL termination call.
long eglGetAndInitDisplay(final long[] nativeDisplayID, final int[] major, final int[] minor)
Implementation should issue an EGL.eglGetDisplay(nativeDisplayID) inclusive EGL.eglInitialize(eglDisp...
void eglTerminate(long eglDisplayHandle)
Implementation should issue an EGL.eglTerminate(eglDisplayHandle) call.