JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
OffscreenLayerSurface.java
Go to the documentation of this file.
1/**
2 * Copyright 2011 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 */
28package com.jogamp.nativewindow;
29
30import com.jogamp.nativewindow.util.PixelRectangle;
31import com.jogamp.nativewindow.util.PointImmutable;
32
33import com.jogamp.common.util.locks.RecursiveLock;
34
35/**
36 * Interface specifying the offscreen layer surface protocol.
37 */
38public interface OffscreenLayerSurface {
39 /**
40 * Attach the offscreen layer to this offscreen layer surface.
41 * <p>
42 * Implementation may realize all required resources at this point.
43 * </p>
44 *
45 * @see #isOffscreenLayerSurfaceEnabled()
46 * @throws NativeWindowException if {@link #isOffscreenLayerSurfaceEnabled()} == false
47 */
48 public void attachSurfaceLayer(final long layerHandle) throws NativeWindowException;
49
50 /**
51 * Detaches a previously attached offscreen layer from this offscreen layer surface.
52 * @see #attachSurfaceLayer(long)
53 * @see #isOffscreenLayerSurfaceEnabled()
54 * @throws NativeWindowException if {@link #isOffscreenLayerSurfaceEnabled()} == false
55 * or no surface layer is attached.
56 */
58
59 /** Returns the attached surface layer or null if none is attached. */
61
62 /** Returns true if a surface layer is attached, otherwise false. */
63 public boolean isSurfaceLayerAttached();
64
65 /** Sets the capabilities of this instance, allowing upstream API's to refine it, i.e. OpenGL related settings. */
67
68 /** Returns the recursive lock object of this surface, which synchronizes multithreaded access. */
69 public RecursiveLock getLock();
70
71 /**
72 * Optional method setting cursor in the corresponding on-screen surface/window, if exists.
73 *
74 * @param pixelrect cursor pixels, maybe null for default cursor
75 * @param hotSpot maybe null for default cursor
76 * @return true if successful, i.e. on-screen surface/window w/ cursor capabilities exists. Otherwise false.
77 */
78 public boolean setCursor(PixelRectangle pixelrect, PointImmutable hotSpot);
79
80 /**
81 * Optional method hiding the cursor in the corresponding on-screen surface/window, if exists.
82 *
83 * @return true if successful, i.e. on-screen surface/window w/ cursor capabilities exists. Otherwise false.
84 */
85 public boolean hideCursor();
86}
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Specifies an immutable set of capabilities that a window's rendering context must support,...
Interface specifying the offscreen layer surface protocol.
void setChosenCapabilities(CapabilitiesImmutable caps)
Sets the capabilities of this instance, allowing upstream API's to refine it, i.e.
void detachSurfaceLayer()
Detaches a previously attached offscreen layer from this offscreen layer surface.
RecursiveLock getLock()
Returns the recursive lock object of this surface, which synchronizes multithreaded access.
long getAttachedSurfaceLayer()
Returns the attached surface layer or null if none is attached.
boolean hideCursor()
Optional method hiding the cursor in the corresponding on-screen surface/window, if exists.
boolean isSurfaceLayerAttached()
Returns true if a surface layer is attached, otherwise false.
boolean setCursor(PixelRectangle pixelrect, PointImmutable hotSpot)
Optional method setting cursor in the corresponding on-screen surface/window, if exists.
void attachSurfaceLayer(final long layerHandle)
Attach the offscreen layer to this offscreen layer surface.
Pixel Rectangle identified by it's hashCode().