public static void main (String[] args) { new HeadlessApplication(new KTXProcessorListener(args)); }
@Override public void log (String tag, String message, Throwable exception) { if (logLevel >= LOG_INFO) getApplicationLogger().log(tag, message, exception); }
@Override public long getNativeHeap () { return getJavaHeap(); }
public HeadlessApplication(ApplicationListener listener, HeadlessApplicationConfiguration config) { if (config == null) config = new HeadlessApplicationConfiguration(); HeadlessNativesLoader.load(); setApplicationLogger(new HeadlessApplicationLogger()); this.listener = listener; this.files = new HeadlessFiles(); this.net = new HeadlessNet(config); // the following elements are not applicable for headless applications // they are only implemented as mock objects this.graphics = new MockGraphics(); this.audio = new MockAudio(); this.input = new MockInput(); this.preferencesdir = config.preferencesDirectory; Gdx.app = this; Gdx.files = files; Gdx.net = net; Gdx.audio = audio; Gdx.graphics = graphics; Gdx.input = input; renderInterval = config.renderInterval > 0 ? (long)(config.renderInterval * 1000000000f) : (config.renderInterval < 0 ? -1 : 0); initialize(); }
public static void init() { if (initialized) { return; } initialized = true; GL20 mockGL = new MockGL(); Gdx.gl = mockGL; Gdx.gl20 = mockGL; final HeadlessApplication application = new HeadlessApplication(new SolApplication(100), new HeadlessApplicationConfiguration()); try { Thread.sleep(10000L); // Magic happens here. If too much tests fail for you, increase this number. } catch (InterruptedException e) { e.printStackTrace(); } game = ((SolApplication) application.getApplicationListener()).getGame(); } }
@Override public void exit () { postRunnable(new Runnable() { @Override public void run () { running = false; } }); }
@Override public void run () { try { HeadlessApplication.this.mainLoop(); } catch (Throwable t) { if (t instanceof RuntimeException) throw (RuntimeException)t; else throw new GdxRuntimeException(t); } } };
t = n + renderInterval; executeRunnables(); graphics.incrementFrameId(); listener.render();
public HeadlessApplication(ApplicationListener listener, HeadlessApplicationConfiguration config) { if (config == null) config = new HeadlessApplicationConfiguration(); HeadlessNativesLoader.load(); setApplicationLogger(new HeadlessApplicationLogger()); this.listener = listener; this.files = new HeadlessFiles(); this.net = new HeadlessNet(config); // the following elements are not applicable for headless applications // they are only implemented as mock objects this.graphics = new MockGraphics(); this.audio = new MockAudio(); this.input = new MockInput(); this.preferencesdir = config.preferencesDirectory; Gdx.app = this; Gdx.files = files; Gdx.net = net; Gdx.audio = audio; Gdx.graphics = graphics; Gdx.input = input; renderInterval = config.renderInterval > 0 ? (long)(config.renderInterval * 1000000000f) : (config.renderInterval < 0 ? -1 : 0); initialize(); }
@Override public void exit () { postRunnable(new Runnable() { @Override public void run () { running = false; } }); }
@Override public void run () { try { HeadlessApplication.this.mainLoop(); } catch (Throwable t) { if (t instanceof RuntimeException) throw (RuntimeException)t; else throw new GdxRuntimeException(t); } } };
t = n + renderInterval; executeRunnables(); graphics.incrementFrameId(); listener.render();
@Override public void error (String tag, String message, Throwable exception) { if (logLevel >= LOG_ERROR) getApplicationLogger().error(tag, message, exception); }
public HeadlessApplication(ApplicationListener listener, HeadlessApplicationConfiguration config) { if (config == null) config = new HeadlessApplicationConfiguration(); HeadlessNativesLoader.load(); setApplicationLogger(new HeadlessApplicationLogger()); this.listener = listener; this.files = new HeadlessFiles(); this.net = new HeadlessNet(config); // the following elements are not applicable for headless applications // they are only implemented as mock objects this.graphics = new MockGraphics(); this.audio = new MockAudio(); this.input = new MockInput(); this.preferencesdir = config.preferencesDirectory; Gdx.app = this; Gdx.files = files; Gdx.net = net; Gdx.audio = audio; Gdx.graphics = graphics; Gdx.input = input; renderInterval = config.renderInterval > 0 ? (long)(config.renderInterval * 1000000000f) : (config.renderInterval < 0 ? -1 : 0); initialize(); }
public static void main (String[] args) { new HeadlessApplication(new KTXProcessorListener(args)); }
@Override public void exit () { postRunnable(new Runnable() { @Override public void run () { running = false; } }); }
@Override public void run () { try { HeadlessApplication.this.mainLoop(); } catch (Throwable t) { if (t instanceof RuntimeException) throw (RuntimeException)t; else throw new GdxRuntimeException(t); } } };
@Override public long getNativeHeap () { return getJavaHeap(); }
t = n + renderInterval; executeRunnables(); graphics.incrementFrameId(); listener.render();
@Override public void debug (String tag, String message) { if (logLevel >= LOG_DEBUG) getApplicationLogger().debug(tag, message); }