com.jogamp.newt
Class OffscreenWindow

java.lang.Object
  extended by com.jogamp.newt.Window
      extended by com.jogamp.newt.OffscreenWindow
All Implemented Interfaces:
NativeWindow, SurfaceChangeable, SurfaceUpdatedListener

public class OffscreenWindow
extends Window
implements SurfaceChangeable


Field Summary
 
Fields inherited from class com.jogamp.newt.Window
caps, ClickTimeout, config, DEBUG_IMPLEMENTATION, DEBUG_KEY_EVENT, DEBUG_MOUSE_EVENT, DEBUG_WINDOW_EVENT, fullscreen, height, nfs_height, nfs_width, nfs_x, nfs_y, parentNativeWindow, parentWindowHandle, screen, title, undecorated, visible, width, windowHandle, windowLock, x, y
 
Fields inherited from interface javax.media.nativewindow.NativeWindow
LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED
 
Constructor Summary
OffscreenWindow()
           
 
Method Summary
protected  void closeNative()
           
protected  void createNativeImpl()
          Create native windowHandle, ie creates a new native invisible window.
 void destroy(boolean deep)
           
 long getSurfaceHandle()
          Returns the handle to the surface for this NativeWindow.
 void invalidate()
           render all native window information invalid, as if the native window was destroyed.
 boolean setFullscreen(boolean fullscreen)
           
protected  boolean setFullscreenImpl(boolean fullscreen, int x, int y, int w, int h)
           
 void setPosition(int x, int y)
          Sets the location of the top left corner of the window, including decorations (so the client area will be placed at x+insets.left,y+insets.top.
This call is ignored if in fullscreen mode.
protected  void setPositionImpl(int x, int y)
           
 void setSize(int width, int height)
          Sets the size of the client area of the window, excluding decorations Total size of the window will be width+insets.left+insets.right, height+insets.top+insets.bottom
protected  void setSizeImpl(int width, int height)
           
 void setSurfaceHandle(long handle)
           
protected  void setVisibleImpl(boolean visible)
           
 
Methods inherited from class com.jogamp.newt.Window
addChild, addKeyListener, addKeyListener, addMouseListener, addMouseListener, addPaintListener, addPaintListener, addSurfaceUpdatedListener, addSurfaceUpdatedListener, addWindowListener, addWindowListener, create, create, destroy, enqueueKeyEvent, enqueueMouseEvent, enqueueWindowEvent, getDisplayHandle, getGraphicsConfiguration, getHeight, getInnerWindow, getInsets, getKeyListener, getKeyListeners, getLockedStack, getMouseListener, getMouseListeners, getPaintListener, getParentNativeWindow, getRequestedCapabilities, getScreen, getScreenIndex, getSurfaceLockOwner, getSurfaceUpdatedListener, getSurfaceUpdatedListeners, getThreadName, getTitle, getWidth, getWindowHandle, getWindowListener, getWindowListeners, getWindowLock, getWrappedWindow, getX, getY, hasDeviceChanged, invalidate, isDestroyed, isFullscreen, isNativeWindowValid, isSurfaceLocked, isUndecorated, isUndecorated, isVisible, lockSurface, removeAllSurfaceUpdatedListener, removeChild, removeKeyListener, removeMouseListener, removePaintListener, removeSurfaceUpdatedListener, removeWindowListener, reparentWindow, reparentWindowImpl, requestFocus, requestFocusImpl, runOnEDTIfAvail, sendEvent, sendKeyEvent, sendMouseEvent, sendPaintEvent, sendPaintEvent, sendWindowEvent, setHandleDestroyNotify, setTitle, setTitleImpl, setUndecorated, setVisible, shouldNotCallThis, surfaceSwap, surfaceUpdated, toHexString, toHexString, toString, unlockSurface, windowDestroyed, windowDestroyNotify, windowIsLocked, windowLock, windowUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OffscreenWindow

public OffscreenWindow()
Method Detail

createNativeImpl

protected void createNativeImpl()
Description copied from class: Window
Create native windowHandle, ie creates a new native invisible window.

Specified by:
createNativeImpl in class Window

closeNative

protected void closeNative()
Specified by:
closeNative in class Window

invalidate

public void invalidate()
Description copied from class: Window

render all native window information invalid, as if the native window was destroyed.

all other resources and states are kept intact, ie listeners, parent handles and size, position etc.

Specified by:
invalidate in interface NativeWindow
Overrides:
invalidate in class Window
See Also:
Window.destroy(), Window.destroy(boolean), Window.invalidate(boolean)

destroy

public void destroy(boolean deep)
Overrides:
destroy in class Window
Parameters:
deep - If true, all resources, ie listeners, parent handles, size, position and the referenced NEWT screen and display, will be destroyed as well. Be aware that if you call this method with deep = true, you will not be able to regenerate the Window.
See Also:
Window.destroy(), Window.invalidate(boolean)

setSurfaceHandle

public void setSurfaceHandle(long handle)
Specified by:
setSurfaceHandle in interface SurfaceChangeable

getSurfaceHandle

public long getSurfaceHandle()
Description copied from interface: NativeWindow
Returns the handle to the surface for this 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.

Specified by:
getSurfaceHandle in interface NativeWindow
Overrides:
getSurfaceHandle in class Window

setVisibleImpl

protected void setVisibleImpl(boolean visible)
Specified by:
setVisibleImpl in class Window

setSize

public void setSize(int width,
                    int height)
Description copied from class: Window
Sets the size of the client area of the window, excluding decorations Total size of the window will be width+insets.left+insets.right, height+insets.top+insets.bottom

Zero size semantics are respected, see Window.setVisible(boolean):

 if ( 0 != windowHandle && 0>=width*height && visible ) {
      setVisible(false);
 } else if ( 0 == windowHandle && 0

This call is ignored if in fullscreen mode.

Specified by:
setSize in interface SurfaceChangeable
Overrides:
setSize in class Window
Parameters:
width - of the client area of the window
height - of the client area of the window

setSizeImpl

protected void setSizeImpl(int width,
                           int height)
Specified by:
setSizeImpl in class Window

setPosition

public void setPosition(int x,
                        int y)
Description copied from class: Window
Sets the location of the top left corner of the window, including decorations (so the client area will be placed at x+insets.left,y+insets.top.
This call is ignored if in fullscreen mode.

Overrides:
setPosition in class Window
Parameters:
x - coord of the top left corner
y - coord of the top left corner

setPositionImpl

protected void setPositionImpl(int x,
                               int y)
Specified by:
setPositionImpl in class Window

setFullscreen

public boolean setFullscreen(boolean fullscreen)
Overrides:
setFullscreen in class Window

setFullscreenImpl

protected boolean setFullscreenImpl(boolean fullscreen,
                                    int x,
                                    int y,
                                    int w,
                                    int h)
Specified by:
setFullscreenImpl in class Window


Copyright 2010 JogAmp Community.