com.badlogic.gdx.backends.headless.HeadlessApplication Java Examples

The following examples show how to use com.badlogic.gdx.backends.headless.HeadlessApplication. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Main.java    From riiablo with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {
  Options options = new Options()
      .addOption("home", true, "directory containing D2 MPQ files")
      .addOption("seed", true, "seed used to generate map")
      .addOption("diff", true, String.format("game difficulty (%d-%d)", Riiablo.NORMAL, Riiablo.MAX_DIFFS - 1))
      ;

  CommandLine cmd = null;
  try {
    CommandLineParser parser = new DefaultParser();
    cmd = parser.parse(options, args);
  } catch (Throwable t) {
    t.printStackTrace(System.err);
    System.out.println("Failed to start server instance!");
    return;
  }

  // TODO: process args and setup server

  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = Animation.FRAME_DURATION;
  new HeadlessApplication(new Main(), config);
}
 
Example #2
Source File: GdxTestRunner.java    From gdx-testing with Apache License 2.0 5 votes vote down vote up
public GdxTestRunner(Class<?> klass) throws InitializationError {
	super(klass);
	HeadlessApplicationConfiguration conf = new HeadlessApplicationConfiguration();

	new HeadlessApplication(this, conf);
	Gdx.gl = mock(GL20.class);
}
 
Example #3
Source File: ControllerMappingsTest.java    From gdx-controllerutils with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() {
    // Note that we don't need to implement any of the listener's methods
    Gdx.app = new HeadlessApplication(new ApplicationListener() {
        @Override
        public void create() {
        }

        @Override
        public void resize(int width, int height) {
        }

        @Override
        public void render() {
        }

        @Override
        public void pause() {
        }

        @Override
        public void resume() {
        }

        @Override
        public void dispose() {
        }
    });

    // Use Mockito to mock the OpenGL methods since we are running headlessly
    Gdx.gl20 = Mockito.mock(GL20.class);
    Gdx.gl = Gdx.gl20;
}
 
Example #4
Source File: ServerCompatibility.java    From Cubes with MIT License 5 votes vote down vote up
@Override
protected void run(ApplicationListener applicationListener) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = -1; // internal loop called from within create()
  
  new HeadlessApplication(applicationListener, config);
}
 
Example #5
Source File: AOTextureGenerator.java    From Cubes with MIT License 5 votes vote down vote up
public static void main(final String[] args) {
  new HeadlessApplication(new ApplicationAdapter() {
    @Override
    public void create() {
      generate(Gdx.files.absolute(new File("ao-texture.png").getAbsolutePath()));
      System.exit(0);
    }
  });
}
 
Example #6
Source File: HeadlessLauncher.java    From gdx-proto with Apache License 2.0 4 votes vote down vote up
public static void main (String[] args) {
	cfg = new HeadlessApplicationConfiguration();
	cfg.renderInterval = 1 / 300f;
	CommandArgs.process(args);
	new HeadlessApplication(new Main(), cfg);
}
 
Example #7
Source File: D2Finder.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  new HeadlessApplication(new D2Finder(args), config);
}
 
Example #8
Source File: BinGenerationTool.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
  new HeadlessApplication(new BinGenerationTool(args));
}
 
Example #9
Source File: CofFinder.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  new HeadlessApplication(new CofFinder(args), config);
}
 
Example #10
Source File: BreakpointsTool.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  new HeadlessApplication(new BreakpointsTool(), config);
}
 
Example #11
Source File: BNLSTest.java    From riiablo with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  new HeadlessApplication(new BNLS(), config);
  Thread.sleep(100);
}
 
Example #12
Source File: BNLS.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  new HeadlessApplication(new BNLS(), config);
}
 
Example #13
Source File: Main.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = Animation.FRAME_DURATION;
  new HeadlessApplication(new Main(), config);
}
 
Example #14
Source File: TestClient.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
  Thread.sleep(1000);
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = Animation.FRAME_DURATION;
  new HeadlessApplication(new TestClient(), config);
}
 
Example #15
Source File: Client.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
  Thread.sleep(1000);
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = Animation.FRAME_DURATION;
  new HeadlessApplication(new Client(), config);
}
 
Example #16
Source File: TestServer.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = Animation.FRAME_DURATION;
  new HeadlessApplication(new TestServer(), config);
}
 
Example #17
Source File: TestClient.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
  Thread.sleep(1000);
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = Animation.FRAME_DURATION;
  new HeadlessApplication(new TestClient(), config);
}
 
Example #18
Source File: TestServer.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = Animation.FRAME_DURATION;
  new HeadlessApplication(new TestServer(), config);
}
 
Example #19
Source File: TestClient.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
  Thread.sleep(1000);
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  config.renderInterval = Animation.FRAME_DURATION;
  new HeadlessApplication(new TestClient(), config);
}
 
Example #20
Source File: Main.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  new HeadlessApplication(new Main(), config);
}
 
Example #21
Source File: MSI.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  new HeadlessApplication(new MSI(), config);
}
 
Example #22
Source File: MCP.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
  new HeadlessApplication(new MCP(), config);
}