JOGL: src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java Source File

JOGL v2.6.0-rc-20250822 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
7 public class UpstreamSurfaceHookMutableSize implements UpstreamSurfaceHook.MutableSize {
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
52 public final NativeSurface getUpstreamSurface() {
53 return null;
54 }
55
56}
57
com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize
Definition: UpstreamSurfaceHookMutableSize.java:7
com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize.destroy
void destroy(final ProxySurface s)
called within ProxySurface#destroyNotify() within lock, before clearing fields.
Definition: UpstreamSurfaceHookMutableSize.java:38
com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize.toString
String toString()
Definition: UpstreamSurfaceHookMutableSize.java:41
com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize.getSurfaceHeight
final int getSurfaceHeight(final ProxySurface s)
Returns the height of the upstream surface in pixels, used if ProxySurface#UPSTREAM_PROVIDES_SIZE is ...
Definition: UpstreamSurfaceHookMutableSize.java:31
com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize.getSurfaceWidth
final int getSurfaceWidth(final ProxySurface s)
Returns the width of the upstream surface in pixels, used if ProxySurface#UPSTREAM_PROVIDES_SIZE is s...
Definition: UpstreamSurfaceHookMutableSize.java:26
com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize.UpstreamSurfaceHookMutableSize
UpstreamSurfaceHookMutableSize(final int width, final int height)
Definition: UpstreamSurfaceHookMutableSize.java:14
com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize.create
void create(final ProxySurface s)
called within ProxySurface#createNotify() within lock, before using surface.
Definition: UpstreamSurfaceHookMutableSize.java:35
com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize.setSurfaceSize
final void setSurfaceSize(final int width, final int height)
Resizes the upstream surface.
Definition: UpstreamSurfaceHookMutableSize.java:20
com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize.getUpstreamSurface
final NativeSurface getUpstreamSurface()
Returns the optional upstream NativeSurface if used by implementation, otherwise null....
Definition: UpstreamSurfaceHookMutableSize.java:52
com.jogamp.nativewindow.NativeSurface
Provides low-level information required for hardware-accelerated rendering using a surface in a platf...
Definition: NativeSurface.java:47
com.jogamp.nativewindow.ProxySurface
Provides a mutable NativeSurface, i.e.
Definition: ProxySurface.java:41
com.jogamp.nativewindow.UpstreamSurfaceHook.MutableSize
UpstreamSurfaceHook w/ mutable size, allowing it's ProxySurface user to resize.
Definition: UpstreamSurfaceHook.java:58
com.jogamp.nativewindow.UpstreamSurfaceHook
Interface allowing upstream caller to pass lifecycle actions and size info to a ProxySurface instance...
Definition: UpstreamSurfaceHook.java:35