Print this page
Added gradle and cmake project

@@ -34,10 +34,12 @@
 import java.awt.Window;
 import java.awt.geom.Rectangle2D;
 import java.util.Objects;
 
 import sun.java2d.SunGraphicsEnvironment;
+import sun.java2d.macos.MacOSFlags;
+import sun.java2d.metal.MTLGraphicsConfig;
 import sun.java2d.opengl.CGLGraphicsConfig;
 
 public final class CGraphicsDevice extends GraphicsDevice
         implements DisplayChangedListener {
 

@@ -63,10 +65,12 @@
     private DisplayMode originalMode;
 
     public CGraphicsDevice(final int displayID) {
         this.displayID = displayID;
         configs = new GraphicsConfiguration[] {
+                MacOSFlags.isMetalEnabled() ?
+                        MTLGraphicsConfig.getConfig(this, displayID, 0) :
             CGLGraphicsConfig.getConfig(this, displayID, 0)
         };
     }
 
     /**

@@ -271,7 +275,9 @@
 
     private static native double nativeGetYResolution(int displayID);
 
     private static native Insets nativeGetScreenInsets(int displayID);
 
+    private static native String nativeGetMetalDeviceName(int displayID);
+
     private static native Rectangle2D nativeGetBounds(int displayID);
 }