|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NativeSurface
Provides low-level information required for hardware-accelerated rendering using a surface in a platform-independent manner.
A NativeSurface created for a particular on- or offscreen component is expected to have the same lifetime as that component. As long as the component is alive and realized/visible, NativeSurface must be able provide information such as the surface handle while it is locked.
Field Summary | |
---|---|
static int |
LOCK_SUCCESS
Returned by lockSurface() if the surface is locked, and is unchanged. |
static int |
LOCK_SURFACE_CHANGED
Returned by lockSurface() if the surface is locked, but has changed. |
static int |
LOCK_SURFACE_NOT_READY
Returned by lockSurface() if the surface is not ready to be locked. |
static int |
LOCK_SURFACE_UNLOCKED
Unlocked state |
Method Summary | |
---|---|
long |
getDisplayHandle()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
AbstractGraphicsConfiguration |
getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window. |
int |
getHeight()
Returns the height of the client area excluding insets (window decorations). |
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 |
getWidth()
Returns the width of the client area excluding insets (window decorations). |
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 |
boolean |
surfaceSwap()
Provide a mechanism to utilize custom (pre-) swap surface code. |
void |
unlockSurface()
Unlock the surface of this native window Shall not modify the surface handle, see lockSurface() |
Methods inherited from interface javax.media.nativewindow.SurfaceUpdatedListener |
---|
surfaceUpdated |
Field Detail |
---|
static final int LOCK_SURFACE_UNLOCKED
static final int LOCK_SURFACE_NOT_READY
lockSurface()
if the surface is not ready to be locked.
static final int LOCK_SURFACE_CHANGED
lockSurface()
if the surface is locked, but has changed.
static final int LOCK_SUCCESS
lockSurface()
if the surface is locked, and is unchanged.
Method Detail |
---|
int lockSurface()
The surface handle, see lockSurface()
,
shall be valid after a successfull call,
ie return a value other than 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).
LOCK_SUCCESS
, LOCK_SURFACE_CHANGED
or LOCK_SURFACE_NOT_READY
.
RuntimeException
- after timeout when waiting for the surface lockRecursiveLock
void unlockSurface() throws NativeWindowException
lockSurface()
The implementation shall also invoke AbstractGraphicsDevice.unlock()
for the final unlock (recursive count zero).
RuntimeException
- if surface is not locked
NativeWindowException
lockSurface()
,
RecursiveLock
boolean isSurfaceLockedByOtherThread()
boolean isSurfaceLocked()
Thread getSurfaceLockOwner()
boolean surfaceSwap()
long getSurfaceHandle()
The surface handle should be set/update by lockSurface()
,
where unlockSurface()
is not allowed to modify it.
After 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.
int getWidth()
int getHeight()
AbstractGraphicsConfiguration getGraphicsConfiguration()
javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
long getDisplayHandle()
int getScreenIndex()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |