42 lines
1.5 KiB
Java
42 lines
1.5 KiB
Java
package advent.core;
|
|
|
|
import clojure.lang.RT;
|
|
import clojure.lang.Symbol;
|
|
|
|
import com.badlogic.gdx.*;
|
|
import com.badlogic.gdx.backends.iosrobovm.*;
|
|
|
|
import org.robovm.apple.foundation.*;
|
|
import org.robovm.apple.uikit.*;
|
|
import org.robovm.apple.glkit.GLKViewDrawableColorFormat;
|
|
import org.robovm.apple.glkit.GLKViewDrawableDepthFormat;
|
|
|
|
public class IOSLauncher extends IOSApplication.Delegate {
|
|
protected IOSApplication createApplication() {
|
|
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
|
|
// config.colorFormat = GLKViewDrawableColorFormat.SRGBA8888;
|
|
// config.depthFormat = GLKViewDrawableDepthFormat._24;
|
|
config.orientationPortrait = false;
|
|
config.orientationLandscape = true;
|
|
config.preferredFramesPerSecond = 30;
|
|
|
|
RT.var("clojure.core", "require").invoke(Symbol.intern("advent.core"));
|
|
try {
|
|
NSDictionary infoDictionary = NSBundle.getMainBundle().getInfoDictionary();
|
|
String version = infoDictionary.get(new NSString("CFBundleShortVersionString")).toString();
|
|
RT.var("advent.version", "version-override").bindRoot(version);
|
|
Game game = (Game) RT.var("advent.core", "advent").deref();
|
|
return new IOSApplication(game, config);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static void main(String[] argv) {
|
|
NSAutoreleasePool pool = new NSAutoreleasePool();
|
|
UIApplication.main(argv, null, IOSLauncher.class);
|
|
pool.close();
|
|
}
|
|
}
|