MCPcopy Create free account
hub / github.com/HumbleUI/JWM / LayerGL

Class LayerGL

shared/java/LayerGL.java:6–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import io.github.humbleui.jwm.impl.RefCounted;
5
6public class LayerGL extends RefCounted implements Layer {
7 @ApiStatus.Internal public Window _window;
8 @ApiStatus.Internal public int _width;
9 @ApiStatus.Internal public int _height;
10
11 public LayerGL() {
12 super(_nMake());
13 }
14
15 @Override
16 public void attach(Window window) {
17 assert _onUIThread() : "Should be run on UI thread";
18 _nAttach(window);
19 _window = window;
20 }
21
22 @Override
23 public void reconfigure() {
24 assert _onUIThread() : "Should be run on UI thread";
25 _nReconfigure();
26 }
27
28 @Override
29 public void resize(int width, int height) {
30 assert _onUIThread() : "Should be run on UI thread";
31 _width = width;
32 _height = height;
33 _nResize(width, height);
34 }
35
36 @Override
37 public int getWidth() {
38 assert _onUIThread() : "Should be run on UI thread";
39 return _width;
40 }
41
42 @Override
43 public int getHeight() {
44 assert _onUIThread() : "Should be run on UI thread";
45 return _height;
46 }
47
48 public void makeCurrent() {
49 assert _onUIThread() : "Should be run on UI thread";
50 _nMakeCurrent();
51 }
52
53 @Override
54 public void swapBuffers() {
55 assert _onUIThread() : "Should be run on UI thread";
56 _nSwapBuffers();
57 }
58
59 @Override
60 public void close() {
61 assert _onUIThread() : "Should be run on UI thread";
62 assert !isClosed() : "Layer is already closed";
63 _nClose();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected