-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathLayerGL.java
More file actions
78 lines (65 loc) · 2.13 KB
/
LayerGL.java
File metadata and controls
78 lines (65 loc) · 2.13 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package io.github.humbleui.jwm;
import org.jetbrains.annotations.ApiStatus;
import io.github.humbleui.jwm.impl.RefCounted;
public class LayerGL extends RefCounted implements Layer {
@ApiStatus.Internal public Window _window;
@ApiStatus.Internal public int _width;
@ApiStatus.Internal public int _height;
public LayerGL() {
super(_nMake());
}
@Override
public void attach(Window window) {
assert _onUIThread() : "Should be run on UI thread";
_window = window;
_nAttach(window);
}
@Override
public void reconfigure() {
assert _onUIThread() : "Should be run on UI thread";
_nReconfigure();
}
@Override
public void resize(int width, int height) {
assert _onUIThread() : "Should be run on UI thread";
_width = width;
_height = height;
_nResize(width, height);
}
@Override
public int getWidth() {
assert _onUIThread() : "Should be run on UI thread";
return _width;
}
@Override
public int getHeight() {
assert _onUIThread() : "Should be run on UI thread";
return _height;
}
public void makeCurrent() {
assert _onUIThread() : "Should be run on UI thread";
_nMakeCurrent();
}
@Override
public void swapBuffers() {
assert _onUIThread() : "Should be run on UI thread";
_nSwapBuffers();
}
@Override
public void close() {
assert _onUIThread() : "Should be run on UI thread";
assert !isClosed() : "Layer is already closed";
_nClose();
super.close();
}
@ApiStatus.Internal public static boolean _onUIThread() {
return App._onUIThread();
}
@ApiStatus.Internal public static native long _nMake();
@ApiStatus.Internal public native void _nAttach(Window window);
@ApiStatus.Internal public native void _nReconfigure();
@ApiStatus.Internal public native void _nMakeCurrent();
@ApiStatus.Internal public native void _nResize(int width, int height);
@ApiStatus.Internal public native void _nSwapBuffers();
@ApiStatus.Internal public native void _nClose();
}