javax.media.nativewindow
Interface ProxySurface

All Superinterfaces:
MutableSurface, NativeSurface, SurfaceUpdatedListener

public interface ProxySurface
extends MutableSurface

Provides a mutable NativeSurface, i.e. MutableSurface, while allowing an UpstreamSurfaceHook to influence the lifecycle and information.

See Also:
UpstreamSurfaceHook, MutableSurface, NativeSurface

Field Summary
static boolean DEBUG
           
static int OPT_PROXY_OWNS_UPSTREAM_DEVICE
          Implementation specific bit-value stating this ProxySurface owns the upstream's AbstractGraphicsDevice.
static int OPT_PROXY_OWNS_UPSTREAM_SURFACE
          Implementation specific bit-value stating this ProxySurface owns the upstream's surface handle
static int OPT_UPSTREAM_WINDOW_INVISIBLE
          Implementation specific bitvalue stating the upstream's NativeSurface is an invisible window, i.e.
 
Fields inherited from interface javax.media.nativewindow.NativeSurface
LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED
 
Method Summary
 void addUpstreamOptionBits(int v)
          Add the given bit-mask to this instance upstream-option-bits using bit-or w/ v.
 void clearUpstreamOptionBits(int v)
          Clear the given bit-mask from this instance upstream-option-bits using bit-and w/ ~v
 boolean containsUpstreamOptionBits(int v)
          Returns true if the give bit-mask v is set in this instance upstream-option-bits, otherwise false.
 void createNotify()
          UpstreamSurfaceHook.create(ProxySurface) is being issued and the proxy surface/window handles shall be set.
 void destroyNotify()
          UpstreamSurfaceHook.destroy(ProxySurface) is being issued and all proxy surface/window handles shall be cleared.
 void enableUpstreamSurfaceHookLifecycle(boolean enable)
          Enables or disables the UpstreamSurfaceHook lifecycle functions UpstreamSurfaceHook.create(ProxySurface) and UpstreamSurfaceHook.destroy(ProxySurface).
 int getUpstreamOptionBits()
           
 StringBuilder getUpstreamOptionBits(StringBuilder sink)
           
 NativeSurface getUpstreamSurface()
          Return the upstream NativeSurface if used, otherwise null.
 UpstreamSurfaceHook getUpstreamSurfaceHook()
          Returns the UpstreamSurfaceHook if set, otherwise null.
 void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg)
          Allow redefining the AbstractGraphicsConfiguration
 void setUpstreamSurfaceHook(UpstreamSurfaceHook hook)
          Sets the UpstreamSurfaceHook and returns the previous value.
 String toString()
           
 StringBuilder toString(StringBuilder sink)
           
 
Methods inherited from interface javax.media.nativewindow.MutableSurface
setSurfaceHandle
 
Methods inherited from interface javax.media.nativewindow.NativeSurface
addSurfaceUpdatedListener, addSurfaceUpdatedListener, getDisplayHandle, getGraphicsConfiguration, getHeight, getScreenIndex, getSurfaceHandle, getSurfaceLockOwner, getWidth, isSurfaceLockedByOtherThread, lockSurface, removeSurfaceUpdatedListener, surfaceSwap, unlockSurface
 
Methods inherited from interface javax.media.nativewindow.SurfaceUpdatedListener
surfaceUpdated
 

Field Detail

DEBUG

static final boolean DEBUG

OPT_PROXY_OWNS_UPSTREAM_SURFACE

static final int OPT_PROXY_OWNS_UPSTREAM_SURFACE
Implementation specific bit-value stating this ProxySurface owns the upstream's surface handle

See Also:
addUpstreamOptionBits(int), clearUpstreamOptionBits(int), getUpstreamOptionBits(), Constant Field Values

OPT_PROXY_OWNS_UPSTREAM_DEVICE

static final int OPT_PROXY_OWNS_UPSTREAM_DEVICE
Implementation specific bit-value stating this ProxySurface owns the upstream's AbstractGraphicsDevice.

See Also:
addUpstreamOptionBits(int), clearUpstreamOptionBits(int), getUpstreamOptionBits(), Constant Field Values

OPT_UPSTREAM_WINDOW_INVISIBLE

static final int OPT_UPSTREAM_WINDOW_INVISIBLE
Implementation specific bitvalue stating the upstream's NativeSurface is an invisible window, i.e. maybe incomplete.

See Also:
addUpstreamOptionBits(int), clearUpstreamOptionBits(int), getUpstreamOptionBits(), Constant Field Values
Method Detail

setGraphicsConfiguration

void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg)
Allow redefining the AbstractGraphicsConfiguration


getUpstreamSurface

NativeSurface getUpstreamSurface()
Return the upstream NativeSurface if used, otherwise null.

An upstream NativeSurface may backup this ProxySurface instance's representation, e.g. via a set UpstreamSurfaceHook.

One example is the JOGL EGLWrappedSurface, which might be backed up by a native platform NativeSurface (X11, WGL, CGL, ..).


getUpstreamSurfaceHook

UpstreamSurfaceHook getUpstreamSurfaceHook()
Returns the UpstreamSurfaceHook if set, otherwise null.


setUpstreamSurfaceHook

void setUpstreamSurfaceHook(UpstreamSurfaceHook hook)
Sets the UpstreamSurfaceHook and returns the previous value.


enableUpstreamSurfaceHookLifecycle

void enableUpstreamSurfaceHookLifecycle(boolean enable)
Enables or disables the UpstreamSurfaceHook lifecycle functions UpstreamSurfaceHook.create(ProxySurface) and UpstreamSurfaceHook.destroy(ProxySurface).

Use this for small code blocks where the native resources shall not change, i.e. resizing a derived (OpenGL) drawable.


createNotify

void createNotify()
UpstreamSurfaceHook.create(ProxySurface) is being issued and the proxy surface/window handles shall be set.


destroyNotify

void destroyNotify()
UpstreamSurfaceHook.destroy(ProxySurface) is being issued and all proxy surface/window handles shall be cleared.


getUpstreamOptionBits

StringBuilder getUpstreamOptionBits(StringBuilder sink)

getUpstreamOptionBits

int getUpstreamOptionBits()

containsUpstreamOptionBits

boolean containsUpstreamOptionBits(int v)
Returns true if the give bit-mask v is set in this instance upstream-option-bits, otherwise false.


addUpstreamOptionBits

void addUpstreamOptionBits(int v)
Add the given bit-mask to this instance upstream-option-bits using bit-or w/ v.


clearUpstreamOptionBits

void clearUpstreamOptionBits(int v)
Clear the given bit-mask from this instance upstream-option-bits using bit-and w/ ~v


toString

StringBuilder toString(StringBuilder sink)

toString

String toString()
Overrides:
toString in class Object


Copyright 2010 JogAmp Community.