package ethanjones.cubes.core.platform.desktop;

import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Files;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;

public class ClientCompatibility extends DesktopCompatibility {

  protected ClientCompatibility(ClientLauncher clientLauncher, String[] arg) {
    super(clientLauncher, Application.ApplicationType.Desktop, arg);
  }

  @Override
  protected void run(ApplicationListener applicationListener) {
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();

    config.addIcon("assets/icon-16x.png", Files.FileType.Internal);
    config.addIcon("assets/icon-32x.png", Files.FileType.Internal);
    config.addIcon("assets/icon-64x.png", Files.FileType.Internal);
    config.addIcon("assets/icon-128x.png", Files.FileType.Internal);

    config.vSyncEnabled = false;
    config.foregroundFPS = 0;
    config.backgroundFPS = 0;
    config.forceExit = false;

    new LwjglApplication(applicationListener, config);
  }
}

@@ -70,95 +70,9 @@
 gdx.
-Application;%0Aimport com.badlogic.gdx.ApplicationListener;%0Aimport com.badlogic.gdx.Files
+*
 ;%0Aim
@@ -197,16 +197,71 @@
 ation;%0A%0A
+import java.util.Arrays;%0Aimport java.util.Comparator;%0A%0A
 public c
@@ -317,16 +317,710 @@
 lity %7B%0A%0A
+  public final static Comparator%3CGraphics.DisplayMode%3E displayModeComparator = new Comparator%3CGraphics.DisplayMode%3E() %7B%0A    @Override%0A    public int compare(Graphics.DisplayMode o1, Graphics.DisplayMode o2) %7B%0A      int i1 = o1.width * o1.height;%0A      int i2 = o2.width * o2.height;%0A      if (i1 %3C i2) return 1;%0A      if (i1 %3E i2) return -1;%0A%0A      if (o1.refreshRate %3C o2.refreshRate) return 1;%0A      if (o1.refreshRate %3E o2.refreshRate) return -1;%0A%0A      if (o1.bitsPerPixel %3C o2.bitsPerPixel) return 1;%0A      if (o1.bitsPerPixel %3E o2.bitsPerPixel) return -1;%0A%0A      return 0;%0A    %7D%0A  %7D;%0A%0A  public boolean fullscreen = false;%0A  public int windowWidth = 640;%0A  public int windowHeight = 480;%0A%0A
   protec
@@ -1680,32 +1680,100 @@
 kgroundFPS = 0;%0A
+%0A    config.width = windowWidth;%0A    config.height = windowHeight;%0A%0A
     config.force
@@ -1845,11 +1845,750 @@
 ig);%0A  %7D
+%0A%0A  @Override%0A  public void render() %7B%0A    super.render();%0A    if (Gdx.input.isKeyJustPressed(Input.Keys.F11)) %7B%0A      if (fullscreen) %7B%0A        if (windowedMode()) fullscreen = false;%0A      %7D else %7B%0A        if (fullscreenMode()) fullscreen = true;%0A      %7D%0A    %7D%0A  %7D%0A%0A  public boolean windowedMode() %7B%0A    return Gdx.graphics.setWindowedMode(windowWidth, windowHeight);%0A  %7D%0A%0A  public boolean fullscreenMode() %7B%0A    windowWidth = Gdx.graphics.getWidth();%0A    windowHeight = Gdx.graphics.getHeight();%0A%0A    Graphics.DisplayMode%5B%5D displayModes = Gdx.graphics.getDisplayModes();%0A    if (displayModes.length == 0) return false;%0A    Arrays.sort(displayModes, displayModeComparator);%0A    return Gdx.graphics.setFullscreenMode(displayModes%5B0%5D);%0A  %7D
 %0A%7D%0A

Add fullscreen mode to desktop (F11)