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

Class LayerMetal

macos/java/LayerMetal.java:6–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected