-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathLayer.java
More file actions
50 lines (42 loc) · 1.54 KB
/
Layer.java
File metadata and controls
50 lines (42 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package io.github.humbleui.jwm;
public interface Layer extends AutoCloseable {
/**
* <p>Attach window to the graphics layer for rendering.</p>
* <p>Must be called once for single window right after layer is created.</p>
* <p>If layer fails to attach window, this method throws LayerNotSupportedException.</p>
*
* @param window window to attach
*/
default void attach(Window window) {}
/**
* <p>Reconfigure layer for attached window.</p>
* <p>Must be called to recreate internal layer platform specific context if window/environment/screen settings changed.</p>
*/
default void reconfigure() {}
/**
* <p>Resize layer framebuffer/area for rendering.</p>
* <p>Must be called for proper rendering if window content area is resized.</p>
*
* @param width new framebuffer width in pixels
* @param height new framebuffer height in pixels
*/
default void resize(int width, int height) {}
default void frame() {}
/**
* <p>Get current layer framebuffer width in pixels.</p>
* @return width in pixels
*/
int getWidth();
/**
* <p>Get current layer framebuffer height in pixels.</p>
* @return height in pixels
*/
int getHeight();
/**
* <p>Request back-buffer swap for presentation on this layer.</p>
* <p>Must be called after each accepted frame event for correct presentation.</p>
*/
default void swapBuffers() {}
@Override
default void close() {}
}