Top Description Fields Methods
com.jogamp.nativewindow

public Interface AbstractGraphicsDevice

extends Cloneable
Known Direct Implementers
com.jogamp.nativewindow.DefaultGraphicsDevice
Imports
jogamp.nativewindow.Debug

A interface describing a graphics device in a toolkit-independent manner.

Field Summary

Modifier and TypeField and Description
public static final boolean
public static final String
DEFAULT_CONNECTION

Dummy connection value for a default connection where no native support for multiple devices is available

public static final int
DEFAULT_UNIT

Default unit id for the 1st device: 0

public static final String
EXTERNAL_CONNECTION

Dummy connection value for an external connection where no native support for multiple devices is available

Method Summary

Modifier and TypeMethod and Description
public void
public Object
public boolean

Returns:

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

Optionally closing the device if handle is not null.

public String
getConnection()

Returns the semantic GraphicsDevice connection.

public long
getHandle()

Returns the native handle of the underlying native device, if such thing exist.

public String
getType()

Returns the type of the underlying subsystem, ie NativeWindowFactory.TYPE_KD, NativeWindowFactory.TYPE_X11, ..

public String
getUniqueID()

Returns a unique ID object of this device using type, connection and unitID as it's key components.

public int
getUnitID()

Returns the graphics device unit ID.

public boolean

Returns:

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

public void
lock()

Optionally locking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#lock().

public boolean

Returns:

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

Optionally [re]opening the device if handle is null.

public void
unlock()

Optionally unlocking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#unlock().

public void

Field Detail

DEBUGback to summary
public static final boolean DEBUG
DEFAULT_CONNECTIONback to summary
public static final String DEFAULT_CONNECTION

Dummy connection value for a default connection where no native support for multiple devices is available

DEFAULT_UNITback to summary
public static final int DEFAULT_UNIT

Default unit id for the 1st device: 0

EXTERNAL_CONNECTIONback to summary
public static final String EXTERNAL_CONNECTION

Dummy connection value for an external connection where no native support for multiple devices is available

Method Detail

clearHandleOwnerback to summary
public void clearHandleOwner()
cloneback to summary
public Object clone()
closeback to summary
public boolean close()

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.

getConnectionback to summary
public String getConnection()

Returns the semantic GraphicsDevice connection.
On platforms supporting remote devices, eg via tcp/ip network, the implementation shall return a unique name for each remote address.
On X11 for example, the connection string should be as the following example.

  • :0.0 for a local connection
  • remote.host.net:0.0 for a remote connection
To support multiple local device, see getUnitID().
getHandleback to summary
public long getHandle()

Returns the native handle of the underlying native device, if such thing exist.

getTypeback to summary
public String getType()

Returns the type of the underlying subsystem, ie NativeWindowFactory.TYPE_KD, NativeWindowFactory.TYPE_X11, ..

getUniqueIDback to summary
public String getUniqueID()

Returns a unique ID object of this device using type, connection and unitID as it's key components.

The unique ID does not reflect the instance of the device, hence the handle is not included. The unique ID may be used as a key for semantic device mapping.

The returned string object reference is unique using String#intern() and hence can be used as a key itself.

getUnitIDback to summary
public int getUnitID()

Returns the graphics device unit ID.
The unit ID support multiple graphics device configurations on a local machine.
To support remote device, see getConnection().

isHandleOwnerback to summary
public boolean isHandleOwner()
Returns:boolean

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

lockback to summary
public void lock()

Optionally locking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#lock(). The lock implementation must be recursive.

openback to summary
public boolean open()

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.

unlockback to summary
public void unlock()

Optionally unlocking the device, utilizing eg com.jogamp.nativewindow.ToolkitLock#unlock(). The lock implementation must be recursive.

Exceptions
RuntimeException:
in case the lock is not acquired by this thread.
validateLockedback to summary
public void validateLocked() throws RuntimeException
Exceptions
RuntimeException:
if current thread does not hold the lock