com.jogamp.opengl
Interface GLStateKeeper

All Known Implementing Classes:
jogamp.opengl.GLAutoDrawableBase, GLAutoDrawableDelegate, GLWindow

public interface GLStateKeeper

Interface adding a GLEventListenerState protocol to GLAutoDrawables or other self-contained compound types combining GLDrawable, GLContext and GLEventListener.

Implementing classes may support preservation of the GLContext state and it's associated GLEventListener.


Nested Class Summary
static interface GLStateKeeper.Listener
          Listener for preserve and restore notifications.
 
Method Summary
 GLEventListenerState clearPreservedGLState()
          Clears the preserved GLEventListenerState from this GLStateKeeper, without destroying it.
 GLEventListenerState getPreservedGLState()
          Returns the preserved GLEventListenerState if preservation was performed, otherwise null.
 boolean isGLStatePreservationSupported()
           
 boolean preserveGLStateAtDestroy(boolean value)
          If set to true, the next GLAutoDrawable#destroy() operation will pull to preserve the GLEventListenerState.
 GLStateKeeper.Listener setGLStateKeeperListener(GLStateKeeper.Listener l)
          Sets a GLStateKeeper.Listener, overriding the old one.
 

Method Detail

setGLStateKeeperListener

GLStateKeeper.Listener setGLStateKeeperListener(GLStateKeeper.Listener l)
Sets a GLStateKeeper.Listener, overriding the old one.

Parameters:
l - the new GLStateKeeper.Listener.
Returns:
the previous GLStateKeeper.Listener.

isGLStatePreservationSupported

boolean isGLStatePreservationSupported()
Returns:
true if GL state preservation is supported in implementation and on current platform, false otherwise.
See Also:
preserveGLStateAtDestroy(boolean), getPreservedGLState(), clearPreservedGLState()

preserveGLStateAtDestroy

boolean preserveGLStateAtDestroy(boolean value)
If set to true, the next GLAutoDrawable#destroy() operation will pull to preserve the GLEventListenerState.

This is a one-shot flag, i.e. after preserving the GLEventListenerState, the flag is cleared.

A preserved GLEventListenerState will be pushed if realized again.

Returns:
true if supported and successful, false otherwise.
See Also:
isGLStatePreservationSupported(), getPreservedGLState(), clearPreservedGLState()

getPreservedGLState

GLEventListenerState getPreservedGLState()
Returns the preserved GLEventListenerState if preservation was performed, otherwise null.

See Also:
isGLStatePreservationSupported(), preserveGLStateAtDestroy(boolean), clearPreservedGLState()

clearPreservedGLState

GLEventListenerState clearPreservedGLState()
Clears the preserved GLEventListenerState from this GLStateKeeper, without destroying it.

Returns:
the preserved and cleared GLEventListenerState if preservation was performed, otherwise null.
See Also:
isGLStatePreservationSupported(), preserveGLStateAtDestroy(boolean), getPreservedGLState()


Copyright 2010 JogAmp Community.