|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.nativewindow.impl.jawt.JAWTWindow
public abstract class JAWTWindow
Field Summary | |
---|---|
protected com.jogamp.nativewindow.util.Rectangle |
bounds
|
protected Component |
component
|
protected AbstractGraphicsConfiguration |
config
|
protected static boolean |
DEBUG
|
protected long |
drawable
|
Fields inherited from interface javax.media.nativewindow.NativeWindow |
---|
LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED |
Constructor Summary | |
---|---|
JAWTWindow(Object comp,
AbstractGraphicsConfiguration config)
|
Method Summary | |
---|---|
void |
destroy()
destroys the window and releases windowing related resources. |
com.jogamp.nativewindow.util.Rectangle |
getBounds()
|
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 window. |
Exception |
getLockedStack()
Return the lock-exception, or null if not locked. |
int |
getScreenIndex()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
long |
getSurfaceHandle()
Returns the handle to the surface for this NativeWindow. |
int |
getWidth()
Returns the current width of this window. |
long |
getWindowHandle()
Returns the window handle for this NativeWindow. |
Object |
getWrappedWindow()
|
protected void |
init(Component windowObject)
|
protected abstract void |
initNative()
|
void |
invalidate()
render all native window information invalid, as if the native window was destroyed |
boolean |
isSurfaceLocked()
Return if surface is locked |
int |
lockSurface()
Lock the surface of this native window |
protected abstract int |
lockSurfaceImpl()
|
void |
setSize(int width,
int height)
|
boolean |
surfaceSwap()
Provide a mechanism to utilize custom (pre-) swap surface code. |
void |
surfaceUpdated(Object updater,
NativeWindow window,
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 NativeWindow.lockSurface() |
protected abstract void |
unlockSurfaceImpl()
|
protected void |
updateBounds(JAWT_Rectangle jawtBounds)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final boolean DEBUG
protected Component component
protected AbstractGraphicsConfiguration config
protected long drawable
protected com.jogamp.nativewindow.util.Rectangle bounds
Constructor Detail |
---|
public JAWTWindow(Object comp, AbstractGraphicsConfiguration config)
Method Detail |
---|
protected void init(Component windowObject) throws NativeWindowException
NativeWindowException
protected abstract void initNative() throws NativeWindowException
NativeWindowException
public void invalidate()
NativeWindow
invalidate
in interface NativeWindow
NativeWindow.destroy()
public void destroy()
NativeWindow
destroy
in interface NativeWindow
protected void updateBounds(JAWT_Rectangle jawtBounds)
protected abstract int lockSurfaceImpl() throws NativeWindowException
NativeWindowException
public final int lockSurface() throws NativeWindowException
NativeWindow
The surface handle, see NativeWindow.lockSurface()
,
shall be set and valid after a successfull call,
ie a return value other than NativeWindow.LOCK_SURFACE_NOT_READY
.
The semantics of the underlying native locked resource
may be related to the ToolkitLock
one. Hence it is
important that implementation of both harmonize well.
The implementation may want to aquire the ToolkitLock
first to become it's owner before proceeding with it's
actual surface lock.
lockSurface
in interface NativeWindow
NativeWindow.LOCK_SUCCESS
, NativeWindow.LOCK_SURFACE_CHANGED
or NativeWindow.LOCK_SURFACE_NOT_READY
.
NativeWindowException
- if surface is already lockedToolkitLock
protected abstract void unlockSurfaceImpl() throws NativeWindowException
NativeWindowException
public void unlockSurface()
NativeWindow
NativeWindow.lockSurface()
unlockSurface
in interface NativeWindow
NativeWindow.lockSurface()
,
ToolkitLock
public boolean isSurfaceLocked()
NativeWindow
isSurfaceLocked
in interface NativeWindow
public Exception getLockedStack()
NativeWindow
NativeWindow.lockSurface()
and hence holds the locker's call stack.
getLockedStack
in interface NativeWindow
public boolean surfaceSwap()
NativeWindow
surfaceSwap
in interface NativeWindow
public void surfaceUpdated(Object updater, NativeWindow window, long when)
SurfaceUpdatedListener
surfaceUpdated
in interface SurfaceUpdatedListener
updater
- is the caller object who updated the surface,
e.g. a JOGL GLDrawable.window
- the NativeWindow, which surface is updatedwhen
- the time in ms, when the surface was updatedpublic long getDisplayHandle()
NativeWindow
getDisplayHandle
in interface NativeWindow
public int getScreenIndex()
NativeWindow
getScreenIndex
in interface NativeWindow
public long getWindowHandle()
NativeWindow
The window handle shall reflect the platform one for all window related operations, e.g. open, close, resize.
On X11 this returns an entity of type Window.
On Microsoft Windows this returns an entity of type HWND.
getWindowHandle
in interface NativeWindow
public long getSurfaceHandle()
NativeWindow
The surface handle should be set/update by NativeWindow.lockSurface()
,
where NativeWindow.unlockSurface()
is not allowed to modify it.
After NativeWindow.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 NativeWindow
public AbstractGraphicsConfiguration getGraphicsConfiguration()
NativeWindow
getGraphicsConfiguration
in interface NativeWindow
GraphicsConfigurationFactory.chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
public Object getWrappedWindow()
public void setSize(int width, int height)
public int getWidth()
NativeWindow
getWidth
in interface NativeWindow
public int getHeight()
NativeWindow
getHeight
in interface NativeWindow
public com.jogamp.nativewindow.util.Rectangle getBounds()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |