Fix TestDesktop to take class as CL arg

Any community contributions to libgdx go here! Some may get included in the core API when permission is granted.

Fix TestDesktop to take class as CL arg

Postby bobcook47 » Fri May 13, 2011 6:48 pm

It was annoying to change the class name and recompile TestDesktop for every test.
Fixed it.
I didn't try looping on argv.size, does JoglApplication return to creator on exit?

import com.badlogic.gdx.backends.jogl.JoglApplication;

public class TestDesktop {
public static void main (String[] argv) {
try {
new JoglApplication((GdxTest)Class.forName(argv[0]).newInstance(), "Simple Test", 480, 320, false);
} catch (Exception e) {
System.out.println(e.toString());
}
}
}
bobcook47
 
Posts: 4
Joined: Fri May 13, 2011 6:43 pm

Re: Fix TestDesktop to take class as CL arg

Postby mzechner » Sun May 15, 2011 12:19 am

Ever tried JoglTestStarter as explained here http://libgdx.badlogicgames.com/documentation.php?
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm


Return to Libgdx Contributions

Who is online

Users browsing this forum: No registered users and 1 guest