JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
UpstreamSurfaceHookMutableSize.java
Go to the documentation of this file.
1package com.jogamp.nativewindow;
2
3import com.jogamp.nativewindow.NativeSurface;
4import com.jogamp.nativewindow.ProxySurface;
5import com.jogamp.nativewindow.UpstreamSurfaceHook;
6
8 int pixWidth, pixHeight;
9
10 /**
11 * @param width initial width
12 * @param height initial height
13 */
14 public UpstreamSurfaceHookMutableSize(final int width, final int height) {
15 this.pixWidth = width;
16 this.pixHeight = height;
17 }
18
19 @Override
20 public final void setSurfaceSize(final int width, final int height) {
21 this.pixWidth = width;
22 this.pixHeight = height;
23 }
24
25 @Override
26 public final int getSurfaceWidth(final ProxySurface s) {
27 return pixWidth;
28 }
29
30 @Override
31 public final int getSurfaceHeight(final ProxySurface s) {
32 return pixHeight;
33 }
34 @Override
35 public void create(final ProxySurface s) { /* nop */ }
36
37 @Override
38 public void destroy(final ProxySurface s) { /* nop */ }
39
40 @Override
41 public String toString() {
42 return getClass().getSimpleName()+"[pixel "+ pixWidth + "x" + pixHeight + "]";
43 }
44
45 /**
46 * {@inheritDoc}
47 * <p>
48 * Returns <code>null</code>.
49 * </p>
50 */
51 @Override
53 return null;
54 }
55
56}
57
void destroy(final ProxySurface s)
called within ProxySurface#destroyNotify() within lock, before clearing fields.
final int getSurfaceHeight(final ProxySurface s)
Returns the height of the upstream surface in pixels, used if ProxySurface#UPSTREAM_PROVIDES_SIZE is ...
final int getSurfaceWidth(final ProxySurface s)
Returns the width of the upstream surface in pixels, used if ProxySurface#UPSTREAM_PROVIDES_SIZE is s...
void create(final ProxySurface s)
called within ProxySurface#createNotify() within lock, before using surface.
final void setSurfaceSize(final int width, final int height)
Resizes the upstream surface.
final NativeSurface getUpstreamSurface()
Returns the optional upstream NativeSurface if used by implementation, otherwise null....
Provides low-level information required for hardware-accelerated rendering using a surface in a platf...
Provides a mutable NativeSurface, i.e.
UpstreamSurfaceHook w/ mutable size, allowing it's ProxySurface user to resize.
Interface allowing upstream caller to pass lifecycle actions and size info to a ProxySurface instance...