com.jogamp.nativewindow.egl
Class EGLGraphicsDevice

java.lang.Object
  extended by javax.media.nativewindow.DefaultGraphicsDevice
      extended by com.jogamp.nativewindow.egl.EGLGraphicsDevice
All Implemented Interfaces:
Cloneable, AbstractGraphicsDevice

public class EGLGraphicsDevice
extends DefaultGraphicsDevice
implements Cloneable

Encapsulates a graphics device on EGL platforms.


Nested Class Summary
static interface EGLGraphicsDevice.EGLDisplayLifecycleCallback
          Hack to allow inject a EGL termination call.
 
Field Summary
 
Fields inherited from interface javax.media.nativewindow.AbstractGraphicsDevice
DEBUG, DEFAULT_CONNECTION, DEFAULT_UNIT, EXTERNAL_CONNECTION
 
Constructor Summary
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)
           
 
Method Summary
 void clearHandleOwner()
           
 Object clone()
           
 boolean close()
          Optionally closing the device if handle is not null.
 long getNativeDisplayID()
           
 boolean isHandleOwner()
           
 boolean open()
          Optionally [re]opening the device if handle is null.
 
Methods inherited from class javax.media.nativewindow.DefaultGraphicsDevice
getConnection, getHandle, getToolkitLock, getType, getUniqueID, getUnitID, lock, swapDeviceHandleAndOwnership, toString, unlock, validateLocked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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(long nativeDisplayID,
                         long eglDisplay,
                         String connection,
                         int unitID,
                         EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback)
Method Detail

getNativeDisplayID

public long getNativeDisplayID()

clone

public Object clone()
Specified by:
clone in interface AbstractGraphicsDevice
Overrides:
clone in class DefaultGraphicsDevice

open

public boolean open()
Description copied from interface: AbstractGraphicsDevice
Optionally [re]opening the device if handle is null.

The default implementation is a NOP.

Example implementations like X11GraphicsDevice or EGLGraphicsDevice issue the native open operation in case handle is null.

Specified by:
open in interface AbstractGraphicsDevice
Overrides:
open in class DefaultGraphicsDevice
Returns:
true if the handle was null and opening was successful, otherwise false.

close

public boolean close()
Description copied from interface: AbstractGraphicsDevice
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 X11GraphicsDevice or EGLGraphicsDevice issue the native close operation or skip it depending on the handles's ownership.

Specified by:
close in interface AbstractGraphicsDevice
Overrides:
close in class DefaultGraphicsDevice
Returns:
true if the handle was not null and closing was successful, otherwise false.

isHandleOwner

public boolean isHandleOwner()
Specified by:
isHandleOwner in interface AbstractGraphicsDevice
Overrides:
isHandleOwner in class DefaultGraphicsDevice
Returns:
true if instance owns the handle to issue AbstractGraphicsDevice.close(), otherwise false.

clearHandleOwner

public void clearHandleOwner()
Specified by:
clearHandleOwner in interface AbstractGraphicsDevice
Overrides:
clearHandleOwner in class DefaultGraphicsDevice


Copyright 2010 JogAmp Community.