JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
UpstreamSurfaceHook.java
Go to the documentation of this file.
1/**
2 * Copyright 2012 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29package com.jogamp.nativewindow;
30
31/**
32 * Interface allowing upstream caller to pass lifecycle actions and size info
33 * to a {@link ProxySurface} instance.
34 */
35public interface UpstreamSurfaceHook {
36 /** called within {@link ProxySurface#createNotify()} within lock, before using surface. */
37 public void create(ProxySurface s);
38 /** called within {@link ProxySurface#destroyNotify()} within lock, before clearing fields. */
39 public void destroy(ProxySurface s);
40
41 /**
42 * Returns the optional upstream {@link NativeSurface} if used by implementation, otherwise <code>null</code>.
43 * <p>
44 * One example is the JOGL EGLWrappedSurface, which might be backed up by a
45 * native platform NativeSurface (X11, WGL, CGL, ..).
46 * </p>
47 */
49
50 /** Returns the width of the upstream surface in pixels, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */
52 /** Returns the height of the upstream surface in pixels, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */
54
55 /**
56 * {@link UpstreamSurfaceHook} w/ mutable size, allowing it's {@link ProxySurface} user to resize.
57 */
58 public interface MutableSize extends UpstreamSurfaceHook {
59 /**
60 * Resizes the upstream surface.
61 * @param width new width in pixel units
62 * @param height new height in pixel units
63 */
64 public void setSurfaceSize(int width, int height);
65 }
66}
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.
void setSurfaceSize(int width, int height)
Resizes the upstream surface.
Interface allowing upstream caller to pass lifecycle actions and size info to a ProxySurface instance...
int getSurfaceHeight(ProxySurface s)
Returns the height of the upstream surface in pixels, used if ProxySurface#UPSTREAM_PROVIDES_SIZE is ...
NativeSurface getUpstreamSurface()
Returns the optional upstream NativeSurface if used by implementation, otherwise null.
void create(ProxySurface s)
called within ProxySurface#createNotify() within lock, before using surface.
int getSurfaceWidth(ProxySurface s)
Returns the width of the upstream surface in pixels, used if ProxySurface#UPSTREAM_PROVIDES_SIZE is s...
void destroy(ProxySurface s)
called within ProxySurface#destroyNotify() within lock, before clearing fields.