Top Description Fields Constructors Methods
jogamp.nativewindow.windows

public Class GDISurface

extends ProxySurfaceImpl
Class Inheritance
Imports
com.jogamp.nativewindow.AbstractGraphicsConfiguration, .AbstractGraphicsDevice, .NativeWindowException, .ProxySurface, .UpstreamSurfaceHook, jogamp.nativewindow.ProxySurfaceImpl, jogamp.nativewindow.windows.GDI

GDI Surface implementation which wraps an existing window handle allowing the use of HDC via lockSurface()/unlockSurface() protocol. The latter will get and release the HDC. The size via getWidth()/getHeight() is invalid.
See Also
ProxySurface

Field Summary

Modifier and TypeField and Description
private long
private long

Constructor Summary

AccessConstructor and Description
public
GDISurface(final AbstractGraphicsConfiguration cfg, final long
the wrapped pre-existing native window handle, maybe 0 if not yet determined
windowHandle
,
final UpstreamSurfaceHook
the UpstreamSurfaceHook to be used
upstream
,
final boolean
true if this ProxySurface instance owns the AbstractGraphicsConfiguration's AbstractGraphicsDevice, otherwise false. Owning the device implies closing it at destroyNotify().
ownsDevice
)

Method Summary

Modifier and TypeMethod and Description
public final int[]
convertToPixelUnits(final int[]
int[2] storage holding the window units for the x- and y-coord to convert and the resulting values.
windowUnitsAndResult
)

Implements com.jogamp.nativewindow.NativeSurface.convertToPixelUnits.

Converts the given window units into pixel units in place.
public final int[]
convertToWindowUnits(final int[]
int[2] storage holding the pixel units for the x- and y-coord to convert and the resulting values.
pixelUnitsAndResult
)

Implements com.jogamp.nativewindow.NativeSurface.convertToWindowUnits.

Converts the given pixel units into window units in place.
public final long
getSurfaceHandle()

Implements abstract jogamp.nativewindow.ProxySurfaceImpl.getSurfaceHandle.

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Returns the handle to the surface for this NativeSurface.
public final long
protected void
invalidateImpl()

Overrides jogamp.nativewindow.ProxySurfaceImpl.invalidateImpl.

Must be overridden by implementations allowing having a UpstreamSurfaceHook being passed.
protected final int
public final void
setSurfaceHandle(final long surfaceHandle)

Implements abstract jogamp.nativewindow.ProxySurfaceImpl.setSurfaceHandle.

Implements com.jogamp.nativewindow.MutableSurface.setSurfaceHandle.

Sets the surface handle which is created outside of this implementation.
public final void
setWindowHandle(final long windowHandle)

Sets the window handle (HWND).

protected final void
Inherited from jogamp.nativewindow.ProxySurfaceImpl:
addSurfaceUpdatedListeneraddSurfaceUpdatedListeneraddUpstreamOptionBitsclearUpstreamOptionBitscontainsUpstreamOptionBitscreateNotifydestroyNotifydumpHierarchyenableUpstreamSurfaceHookLifecyclegetDisplayHandlegetGraphicsConfigurationgetScreenIndexgetSurfaceHeightgetSurfaceLockOwnergetSurfaceWidthgetUpstreamOptionBitsgetUpstreamOptionBitsgetUpstreamSurfacegetUpstreamSurfaceHookisSurfaceLockedByOtherThreadlockSurfaceremoveSurfaceUpdatedListenersetGraphicsConfigurationsetUpstreamSurfaceHooksurfaceSwapsurfaceUpdatedtoStringtoStringunlockSurfacevalidateSurfaceLocked

Field Detail

surfaceHandleback to summary
private long surfaceHandle
windowHandleback to summary
private long windowHandle

Constructor Detail

GDISurfaceback to summary
public GDISurface(final AbstractGraphicsConfiguration cfg, final long windowHandle, final UpstreamSurfaceHook upstream, final boolean ownsDevice)
Parameters
cfg:AbstractGraphicsConfiguration

the AbstractGraphicsConfiguration to be used

windowHandle:long

the wrapped pre-existing native window handle, maybe 0 if not yet determined

upstream:UpstreamSurfaceHook

the UpstreamSurfaceHook to be used

ownsDevice:boolean

true if this ProxySurface instance owns the AbstractGraphicsConfiguration's AbstractGraphicsDevice, otherwise false. Owning the device implies closing it at destroyNotify().

Method Detail

convertToPixelUnitsback to summary
public final int[] convertToPixelUnits(final int[] windowUnitsAndResult)

Implements com.jogamp.nativewindow.NativeSurface.convertToPixelUnits.

Doc from com.jogamp.nativewindow.NativeSurface.convertToPixelUnits.

Converts the given window units into pixel units in place.

Parameters
windowUnitsAndResult:int[]

int[2] storage holding the window units for the x- and y-coord to convert and the resulting values.

Returns:int[]

result int[2] storage windowUnitsAndResult for chaining holding the converted values

Annotations
@Override
convertToWindowUnitsback to summary
public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult)

Implements com.jogamp.nativewindow.NativeSurface.convertToWindowUnits.

Doc from com.jogamp.nativewindow.NativeSurface.convertToWindowUnits.

Converts the given pixel units into window units in place.

Parameters
pixelUnitsAndResult:int[]

int[2] storage holding the pixel units for the x- and y-coord to convert and the resulting values.

Returns:int[]

result int[2] storage pixelUnitsAndResult for chaining holding the converted values

Annotations
@Override
getSurfaceHandleback to summary
public final long getSurfaceHandle()

Implements abstract jogamp.nativewindow.ProxySurfaceImpl.getSurfaceHandle.

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Doc from com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Returns the handle to the surface for this NativeSurface.

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.

Annotations
@Override
getWindowHandleback to summary
public final long getWindowHandle()
invalidateImplback to summary
protected void invalidateImpl()

Overrides jogamp.nativewindow.ProxySurfaceImpl.invalidateImpl.

Doc from jogamp.nativewindow.ProxySurfaceImpl.invalidateImpl.

Must be overridden by implementations allowing having a UpstreamSurfaceHook being passed.

Annotations
@Override
lockSurfaceImplback to summary
protected final int lockSurfaceImpl()

Implements abstract jogamp.nativewindow.ProxySurfaceImpl.lockSurfaceImpl.

Annotations
@Override
setSurfaceHandleback to summary
public final void setSurfaceHandle(final long surfaceHandle)

Implements abstract jogamp.nativewindow.ProxySurfaceImpl.setSurfaceHandle.

Implements com.jogamp.nativewindow.MutableSurface.setSurfaceHandle.

Doc from com.jogamp.nativewindow.MutableSurface.setSurfaceHandle.

Sets the surface handle which is created outside of this implementation.

Actually the window handle (HWND), since the surfaceHandle (HDC) is derived from it at lockSurface().

Annotations
@Override
setWindowHandleback to summary
public final void setWindowHandle(final long windowHandle)

Sets the window handle (HWND).

unlockSurfaceImplback to summary
protected final void unlockSurfaceImpl()

Implements abstract jogamp.nativewindow.ProxySurfaceImpl.unlockSurfaceImpl.

Annotations
@Override