JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.GLEventListenerState Class Reference

GLEventListenerState is holding GLAutoDrawable components crucial to relocating all its GLEventListener w/ their operating GLContext, etc. More...

Collaboration diagram for com.jogamp.opengl.GLEventListenerState:

Public Member Functions

final boolean isOwner ()
 Returns true, if this instance is the current owner of the components, otherwise false. More...
 
final int listenerCount ()
 
Runnable getUnlockSurfaceOp ()
 Returns a Runnable unlocking an eventually locked NativeSurface, see moveFrom(GLAutoDrawable, boolean) and moveTo(GLAutoDrawable, Runnable). More...
 
void destroy ()
 Last resort to destroy and loose ownership. More...
 
final void moveTo (final GLAutoDrawable dest) throws GLException
 Moves all GLEventListenerState components to the given GLAutoDrawable from this instance, while loosing ownership. More...
 
final void moveTo (final GLAutoDrawable dest, final Runnable destUnlockOperation) throws GLException
 Moves all GLEventListenerState components to the given GLAutoDrawable from this instance, while loosing ownership. More...
 

Static Public Member Functions

static GLEventListenerState moveFrom (final GLAutoDrawable src)
 Moves all GLEventListenerState components from the given GLAutoDrawable to a newly created instance. More...
 
static GLEventListenerState moveFrom (final GLAutoDrawable src, final boolean keepLocked)
 Moves all GLEventListenerState components from the given GLAutoDrawable to a newly created instance. More...
 

Public Attributes

final AbstractGraphicsDevice upstreamDevice
 
final boolean proxyOwnsUpstreamDevice
 
final AbstractGraphicsDevice device
 
final GLCapabilitiesImmutable caps
 
final GLContext context
 
final GLEventListener[] listeners
 
final boolean[] listenersInit
 
final GLAnimatorControl anim
 
final boolean animStarted
 

Detailed Description

GLEventListenerState is holding GLAutoDrawable components crucial to relocating all its GLEventListener w/ their operating GLContext, etc.

The components are:

A GLEventListenerState instance can be created while components are moved from a GLAutoDrawable to the new instance, which gains ownership of the moved components.

A GLEventListenerState instance's components can be moved to a GLAutoDrawable, while loosing ownership of the moved components.

Definition at line 72 of file GLEventListenerState.java.

Member Function Documentation

◆ destroy()

void com.jogamp.opengl.GLEventListenerState.destroy ( )

Last resort to destroy and loose ownership.

Definition at line 142 of file GLEventListenerState.java.

Here is the call graph for this function:

◆ getUnlockSurfaceOp()

Runnable com.jogamp.opengl.GLEventListenerState.getUnlockSurfaceOp ( )

Returns a Runnable unlocking an eventually locked NativeSurface, see moveFrom(GLAutoDrawable, boolean) and moveTo(GLAutoDrawable, Runnable).

Definition at line 123 of file GLEventListenerState.java.

Here is the caller graph for this function:

◆ isOwner()

final boolean com.jogamp.opengl.GLEventListenerState.isOwner ( )

Returns true, if this instance is the current owner of the components, otherwise false.

Ownership is lost if moveTo(GLAutoDrawable) is being called successfully and all components are transferred to the new GLAutoDrawable.

Definition at line 101 of file GLEventListenerState.java.

◆ listenerCount()

final int com.jogamp.opengl.GLEventListenerState.listenerCount ( )

Definition at line 103 of file GLEventListenerState.java.

Here is the caller graph for this function:

◆ moveFrom() [1/2]

static GLEventListenerState com.jogamp.opengl.GLEventListenerState.moveFrom ( final GLAutoDrawable  src)
static

Moves all GLEventListenerState components from the given GLAutoDrawable to a newly created instance.

Note that all components are removed from the GLAutoDrawable, i.e. the GLContext, all GLEventListener.

If the GLAutoDrawable was added to a GLAnimatorControl, it is removed and the GLAnimatorControl added to the GLEventListenerState.

The returned GLEventListenerState instance is the owner of the components.

Locking is performed on the auto-drawable's upstream-lock and surface. See GLAutoDrawable Locking.

Parameters
srcGLAutoDrawable source to move components from
Returns
new GLEventListenerState instance owning moved components.
See also
moveTo(GLAutoDrawable)

Definition at line 184 of file GLEventListenerState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveFrom() [2/2]

static GLEventListenerState com.jogamp.opengl.GLEventListenerState.moveFrom ( final GLAutoDrawable  src,
final boolean  keepLocked 
)
static

Moves all GLEventListenerState components from the given GLAutoDrawable to a newly created instance.

Note that all components are removed from the GLAutoDrawable, i.e. the GLContext, all GLEventListener.

If the GLAutoDrawable was added to a GLAnimatorControl, it is removed and the GLAnimatorControl added to the GLEventListenerState.

The returned GLEventListenerState instance is the owner of the components.

Locking is performed on the auto-drawable's upstream-lock and surface, which is not released if keepLocked is true. See GLAutoDrawable Locking.

keepLocked may be utilized if swapping a context between drawables and to ensure atomicity of operation. Here, the getUnlockSurfaceOp() shall be passed to moveTo(GLAutoDrawable, Runnable). See GLDrawableUtil#swapGLContextAndAllGLEventListener(GLAutoDrawable, GLAutoDrawable).

Parameters
srcGLAutoDrawable source to move components from
keepLockedkeep upstream-lock and surface locked, see above
Returns
new GLEventListenerState instance owning moved components.
See also
moveTo(GLAutoDrawable, Runnable)

Definition at line 221 of file GLEventListenerState.java.

Here is the call graph for this function:

◆ moveTo() [1/2]

final void com.jogamp.opengl.GLEventListenerState.moveTo ( final GLAutoDrawable  dest) throws GLException

Moves all GLEventListenerState components to the given GLAutoDrawable from this instance, while loosing ownership.

If the previous GLAutoDrawable was removed from a GLAnimatorControl by previous moveFrom(GLAutoDrawable), the given GLAutoDrawable is added to the cached GLAnimatorControl. This operation is skipped, if the given GLAutoDrawable is already added to a GLAnimatorControl instance.

Locking is performed on the auto-drawable's upstream-lock and surface. See GLAutoDrawable Locking.

Note: After this operation, the GLEventListenerState reference should be released.

Parameters
destGLAutoDrawable destination to move GLEventListenerState components to
Exceptions
GLExceptionif a realized surface could not be locked.
GLExceptionif this preserved AbstractGraphicsDevice is incompatible w/ the given destination one.
See also
moveFrom(GLAutoDrawable)
isOwner()

Definition at line 339 of file GLEventListenerState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveTo() [2/2]

final void com.jogamp.opengl.GLEventListenerState.moveTo ( final GLAutoDrawable  dest,
final Runnable  destUnlockOperation 
) throws GLException

Moves all GLEventListenerState components to the given GLAutoDrawable from this instance, while loosing ownership.

If the previous GLAutoDrawable was removed from a GLAnimatorControl by previous moveFrom(GLAutoDrawable, boolean), the given GLAutoDrawable is added to the cached GLAnimatorControl. This operation is skipped, if the given GLAutoDrawable is already added to a GLAnimatorControl instance.

Locking is performed on the auto-drawable's upstream-lock and surface. See GLAutoDrawable Locking.

If the GLAutoDrawable dest has been kept locked by moveFrom(GLAutoDrawable, boolean), it's getUnlockSurfaceOp() shall be passed here to destUnlockOperation to be unlocked.

Note: After this operation, the GLEventListenerState reference should be released.

Parameters
destGLAutoDrawable destination to move GLEventListenerState components to
destUnlockOperationoptional unlock operation for dest, see moveFrom(GLAutoDrawable, boolean).
Exceptions
GLExceptionif a realized surface could not be locked.
GLExceptionif this preserved AbstractGraphicsDevice is incompatible w/ the given destination one.
See also
moveFrom(GLAutoDrawable, boolean)
isOwner()

Definition at line 374 of file GLEventListenerState.java.

Here is the call graph for this function:

Member Data Documentation

◆ anim

final GLAnimatorControl com.jogamp.opengl.GLEventListenerState.anim

Definition at line 112 of file GLEventListenerState.java.

◆ animStarted

final boolean com.jogamp.opengl.GLEventListenerState.animStarted

Definition at line 113 of file GLEventListenerState.java.

◆ caps

final GLCapabilitiesImmutable com.jogamp.opengl.GLEventListenerState.caps

Definition at line 108 of file GLEventListenerState.java.

◆ context

final GLContext com.jogamp.opengl.GLEventListenerState.context

Definition at line 109 of file GLEventListenerState.java.

◆ device

final AbstractGraphicsDevice com.jogamp.opengl.GLEventListenerState.device

Definition at line 107 of file GLEventListenerState.java.

◆ listeners

final GLEventListener [] com.jogamp.opengl.GLEventListenerState.listeners

Definition at line 110 of file GLEventListenerState.java.

◆ listenersInit

final boolean [] com.jogamp.opengl.GLEventListenerState.listenersInit

Definition at line 111 of file GLEventListenerState.java.

◆ proxyOwnsUpstreamDevice

final boolean com.jogamp.opengl.GLEventListenerState.proxyOwnsUpstreamDevice

Definition at line 106 of file GLEventListenerState.java.

◆ upstreamDevice

final AbstractGraphicsDevice com.jogamp.opengl.GLEventListenerState.upstreamDevice

Definition at line 105 of file GLEventListenerState.java.


The documentation for this class was generated from the following file: