|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.nativewindow.impl.ProxySurface
public class ProxySurface
Field Summary | |
---|---|
protected AbstractGraphicsConfiguration |
config
|
protected long |
displayHandle
|
protected int |
height
|
protected int |
scrnIndex
|
protected long |
surfaceHandle
|
protected int |
width
|
Fields inherited from interface javax.media.nativewindow.NativeSurface |
---|
LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED |
Constructor Summary | |
---|---|
ProxySurface(AbstractGraphicsConfiguration cfg)
|
|
ProxySurface(AbstractGraphicsConfiguration cfg,
long handle)
|
Method Summary | |
---|---|
void |
destroy()
|
long |
getDisplayHandle()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
AbstractGraphicsConfiguration |
getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window. |
int |
getHeight()
Returns the current height of this surface. |
NativeWindow |
getParent()
|
int |
getScreenIndex()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
long |
getSurfaceHandle()
Returns the handle to the surface for this NativeSurface. |
Thread |
getSurfaceLockOwner()
Return the locking owner's Thread, or null if not locked. |
int |
getSurfaceRecursionCount()
|
int |
getWidth()
Returns the current width of this surface. |
protected void |
init(Object windowObject)
|
protected void |
initNative()
|
void |
invalidate()
|
boolean |
isSurfaceLocked()
Return if surface is locked |
boolean |
isSurfaceLockedByOtherThread()
Return if surface is locked by another thread, ie not the current one |
int |
lockSurface()
Lock the surface of this native window |
void |
setSize(int width,
int height)
|
void |
setSurfaceHandle(long surfaceHandle)
|
boolean |
surfaceSwap()
Provide a mechanism to utilize custom (pre-) swap surface code. |
void |
surfaceUpdated(Object updater,
NativeSurface ns,
long when)
Notification of a surface update event. |
String |
toString()
|
void |
unlockSurface()
Unlock the surface of this native window Shall not modify the surface handle, see NativeSurface.lockSurface() |
void |
validateSurfaceLocked()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected AbstractGraphicsConfiguration config
protected long displayHandle
protected long surfaceHandle
protected int scrnIndex
protected int width
protected int height
Constructor Detail |
---|
public ProxySurface(AbstractGraphicsConfiguration cfg)
public ProxySurface(AbstractGraphicsConfiguration cfg, long handle)
Method Detail |
---|
protected void init(Object windowObject) throws NativeWindowException
NativeWindowException
protected void initNative() throws NativeWindowException
NativeWindowException
public NativeWindow getParent()
public void destroy()
public void invalidate()
public final int lockSurface() throws NativeWindowException
NativeSurface
The surface handle, see NativeSurface.lockSurface()
,
shall be valid after a successfull call,
ie return a value other than NativeSurface.LOCK_SURFACE_NOT_READY
.
This call is blocking until the surface has been locked or a timeout is reached. The latter will throw a runtime exception.
This call allows recursion from the same thread.
The implementation may want to aquire the
application level RecursiveLock
first before proceeding with a native surface lock.
The implementation shall also invoke AbstractGraphicsDevice.lock()
for the initial lock (recursive count zero).
lockSurface
in interface NativeSurface
NativeSurface.LOCK_SUCCESS
, NativeSurface.LOCK_SURFACE_CHANGED
or NativeSurface.LOCK_SURFACE_NOT_READY
.
NativeWindowException
RecursiveLock
public final void unlockSurface()
NativeSurface
NativeSurface.lockSurface()
The implementation shall also invoke AbstractGraphicsDevice.unlock()
for the final unlock (recursive count zero).
unlockSurface
in interface NativeSurface
NativeSurface.lockSurface()
,
RecursiveLock
public final void validateSurfaceLocked()
public final int getSurfaceRecursionCount()
public final boolean isSurfaceLockedByOtherThread()
NativeSurface
isSurfaceLockedByOtherThread
in interface NativeSurface
public final boolean isSurfaceLocked()
NativeSurface
isSurfaceLocked
in interface NativeSurface
public final Thread getSurfaceLockOwner()
NativeSurface
getSurfaceLockOwner
in interface NativeSurface
public boolean surfaceSwap()
NativeSurface
surfaceSwap
in interface NativeSurface
public long getSurfaceHandle()
NativeSurface
The surface handle should be set/update by NativeSurface.lockSurface()
,
where NativeSurface.unlockSurface()
is not allowed to modify it.
After NativeSurface.unlockSurface()
it is no more guaranteed
that the surface handle is still valid.
The surface handle shall reflect the platform one
for all drawable surface operations, e.g. opengl, swap-buffer.
On X11 this returns an entity of type Window,
since there is no differentiation of surface and window there.
On Microsoft Windows this returns an entity of type HDC.
getSurfaceHandle
in interface NativeSurface
public int getWidth()
NativeSurface
getWidth
in interface NativeSurface
public int getHeight()
NativeSurface
getHeight
in interface NativeSurface
public AbstractGraphicsConfiguration getGraphicsConfiguration()
NativeSurface
getGraphicsConfiguration
in interface NativeSurface
javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
public void surfaceUpdated(Object updater, NativeSurface ns, long when)
SurfaceUpdatedListener
surfaceUpdated
in interface SurfaceUpdatedListener
updater
- is the caller object who updated the surface,
e.g. a JOGL GLDrawable.ns
- the updated NativeSurfacewhen
- the time in ms, when the surface was updatedpublic long getDisplayHandle()
NativeSurface
getDisplayHandle
in interface NativeSurface
public int getScreenIndex()
NativeSurface
getScreenIndex
in interface NativeSurface
public void setSurfaceHandle(long surfaceHandle)
setSurfaceHandle
in interface SurfaceChangeable
public void setSize(int width, int height)
setSize
in interface SurfaceChangeable
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |