Top Description Inners Fields Constructors Methods
com.jogamp.nativewindow.egl

public Class EGLGraphicsDevice

extends DefaultGraphicsDevice
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
com.jogamp.common.util.VersionNumber, com.jogamp.nativewindow.AbstractGraphicsDevice, .DefaultGraphicsDevice, .NativeWindowException, .NativeWindowFactory

Encapsulates a graphics device on EGL platforms.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
EGLGraphicsDevice.EGLDisplayLifecycleCallback

Hack to allow inject a EGL termination call.

Field Summary

Modifier and TypeField and Description
private EGLGraphicsDevice.EGLDisplayLifecycleCallback
private VersionNumber
private final long[]
Inherited from com.jogamp.nativewindow.DefaultGraphicsDevice:
connectionhandletoolkitLockuniqueIDunitID

Constructor Summary

AccessConstructor and Description
public
EGLGraphicsDevice()

Note that this is not an open connection, ie no native display handle exist.

public
EGLGraphicsDevice(final AbstractGraphicsDevice aDevice, final long eglDisplay, final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback)

public
EGLGraphicsDevice(final long nativeDisplayID, final long eglDisplay, final String connection, final int unitID, final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback)

Method Summary

Modifier and TypeMethod and Description
public void
public Object
public boolean
close()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.close.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.close.

Closes the EGL device if handle is not null and it's EGLDisplayLifecycleCallback is valid.
public VersionNumber
getEGLVersion()

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

protected Object
public long
public boolean
public boolean
protected Object
public String
toString()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.toString.

Returns a string representation of the object.
Inherited from com.jogamp.nativewindow.DefaultGraphicsDevice:
getConnectiongetDefaultDisplayConnectiongetDefaultDisplayConnectiongetHandlegetToolkitLockgetTypegetUniqueIDgetUnitIDlocksetHandlesetToolkitLockswapDeviceHandleAndOwnershipunlockvalidateLocked

Field Detail

eglLifecycleCallbackback to summary
private EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback
eglVersionback to summary
private VersionNumber eglVersion
nativeDisplayIDback to summary
private final long[] nativeDisplayID

Constructor Detail

EGLGraphicsDeviceback to summary
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.

EGLGraphicsDeviceback to summary
public EGLGraphicsDevice(final AbstractGraphicsDevice aDevice, final long eglDisplay, final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback)
EGLGraphicsDeviceback to summary
public EGLGraphicsDevice(final long nativeDisplayID, final long eglDisplay, final String connection, final int unitID, final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback)

Method Detail

clearHandleOwnerback to summary
public void clearHandleOwner()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.clearHandleOwner.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.clearHandleOwner.

Annotations
@Override
cloneback to summary
public Object clone()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.clone.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
closeback to summary
public boolean close()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.close.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.close.

Doc from com.jogamp.nativewindow.AbstractGraphicsDevice.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:boolean

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

Annotations
@Override
getEGLVersionback to summary
public VersionNumber getEGLVersion()

EGL server version as returned by eglInitialize(..). Only valid after open().

getHandleOwnershipback to summary
protected Object getHandleOwnership()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.getHandleOwnership.

Annotations
@Override
getNativeDisplayIDback to summary
public long getNativeDisplayID()
isHandleOwnerback to summary
public boolean isHandleOwner()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.isHandleOwner.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.isHandleOwner.

Returns:boolean

Doc from com.jogamp.nativewindow.AbstractGraphicsDevice.isHandleOwner.

true if instance owns the handle to issue close(), otherwise false.

Annotations
@Override
openback to summary
public boolean open()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.open.

Implements com.jogamp.nativewindow.AbstractGraphicsDevice.open.

Doc from com.jogamp.nativewindow.AbstractGraphicsDevice.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:boolean

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

Annotations
@Override
setHandleOwnershipback to summary
protected Object setHandleOwnership(final Object newOwnership)

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.setHandleOwnership.

Annotations
@Override
toStringback to summary
public String toString()

Overrides com.jogamp.nativewindow.DefaultGraphicsDevice.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
com.jogamp.nativewindow.egl back to summary

public Interface EGLGraphicsDevice.EGLDisplayLifecycleCallback


Hack to allow inject a EGL termination call.

FIXME: This shall be removed when relocated EGL to the nativewindow package, since then it can be utilized directly.

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

the initialized EGL display ID, or 0 if not successful
eglGetAndInitDisplay
(final long[]
in/out array of size 1, passing the requested nativeVisualID, may return a different revised nativeVisualID handle
nativeDisplayID
,
final int[]
out array for EGL major version
major
,
final int[]
out array for EGL minor version
minor
)

Implementation should issue an EGL.eglGetDisplay(nativeDisplayID) inclusive EGL.eglInitialize(eglDisplayHandle, ..) call.

public void
eglTerminate(long eglDisplayHandle)

Implementation should issue an EGL.eglTerminate(eglDisplayHandle) call.

Method Detail

eglGetAndInitDisplayback to summary
public long eglGetAndInitDisplay(final long[] nativeDisplayID, final int[] major, final int[] minor)

Implementation should issue an EGL.eglGetDisplay(nativeDisplayID) inclusive EGL.eglInitialize(eglDisplayHandle, ..) call.

Parameters
nativeDisplayID:long[]

in/out array of size 1, passing the requested nativeVisualID, may return a different revised nativeVisualID handle

major:int[]

out array for EGL major version

minor:int[]

out array for EGL minor version

Returns:long

the initialized EGL display ID, or 0 if not successful

eglTerminateback to summary
public void eglTerminate(long eglDisplayHandle)

Implementation should issue an EGL.eglTerminate(eglDisplayHandle) call.