com.jogamp.nativewindow

## Class UpstreamSurfaceHookMutableSize

- java.lang.Object
- - com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize

- All Implemented Interfaces:
    UpstreamSurfaceHook, UpstreamSurfaceHook.MutableSize
  Direct Known Subclasses:
    DelegatedUpstreamSurfaceHookMutableSize, UpstreamWindowHookMutableSizePos

      public class UpstreamSurfaceHookMutableSize
      extends Object
      implements UpstreamSurfaceHook.MutableSize

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface javax.media.nativewindow.UpstreamSurfaceHook

      `UpstreamSurfaceHook.MutableSize`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UpstreamSurfaceHookMutableSize(int width, int height)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `create(ProxySurface s)` called within `ProxySurface.createNotify()` within lock, before using surface.
    `void` | `destroy(ProxySurface s)` called within `ProxySurface.destroyNotify()` within lock, before clearing fields.
    `int` | `getSurfaceHeight(ProxySurface s)` Returns the height of the upstream surface in pixels, used if `ProxySurface#UPSTREAM_PROVIDES_SIZE` is set.
    `int` | `getSurfaceWidth(ProxySurface s)` Returns the width of the upstream surface in pixels, used if `ProxySurface#UPSTREAM_PROVIDES_SIZE` is set.
    `NativeSurface` | `getUpstreamSurface()` Returns the optional upstream `NativeSurface` if used by implementation, otherwise `null`.
    `void` | `setSurfaceSize(int width, int height)` Resizes the upstream surface.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### UpstreamSurfaceHookMutableSize

          public UpstreamSurfaceHookMutableSize(int width,
                                        int height)

      Parameters:
        `width` - initial width
        `height` - initial height

  - ### Method Detail

    - #### setSurfaceSize

          public final void setSurfaceSize(int width,
                            int height)

      Description copied from interface: `UpstreamSurfaceHook.MutableSize`
      Resizes the upstream surface.
      Specified by:
        `setSurfaceSize` in interface `UpstreamSurfaceHook.MutableSize`
      Parameters:
        `width` - new width in pixel units
        `height` - new height in pixel units

    - #### getSurfaceWidth

          public final int getSurfaceWidth(ProxySurface s)

      Description copied from interface: `UpstreamSurfaceHook`
      Returns the width of the upstream surface in pixels, used if `ProxySurface#UPSTREAM_PROVIDES_SIZE` is set.
      Specified by:
        `getSurfaceWidth` in interface `UpstreamSurfaceHook`

    - #### getSurfaceHeight

          public final int getSurfaceHeight(ProxySurface s)

      Description copied from interface: `UpstreamSurfaceHook`
      Returns the height of the upstream surface in pixels, used if `ProxySurface#UPSTREAM_PROVIDES_SIZE` is set.
      Specified by:
        `getSurfaceHeight` in interface `UpstreamSurfaceHook`

    - #### create

          public void create(ProxySurface s)

      Description copied from interface: `UpstreamSurfaceHook`
      called within `ProxySurface.createNotify()` within lock, before using surface.
      Specified by:
        `create` in interface `UpstreamSurfaceHook`

    - #### destroy

          public void destroy(ProxySurface s)

      Description copied from interface: `UpstreamSurfaceHook`
      called within `ProxySurface.destroyNotify()` within lock, before clearing fields.
      Specified by:
        `destroy` in interface `UpstreamSurfaceHook`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getUpstreamSurface

          public final NativeSurface getUpstreamSurface()

      Returns the optional upstream `NativeSurface` if used by implementation, otherwise `null`.

      One example is the JOGL EGLWrappedSurface, which might be backed up by a native platform NativeSurface (X11, WGL, CGL, ..).

      Returns `null`.

      Specified by:
        `getUpstreamSurface` in interface `UpstreamSurfaceHook`

Copyright 2010 JogAmp Community.