public class Main extends SimpleGame {
/**
* Main method is the entry point for this lesson. It creates a SimpleGame
* and tells the dialog to always appear. It then starts the main loop.
*
* @param args
*/
public static void main(String[] args) {
Main app = new Main();
app.setConfigShowMode(ConfigShowMode.AlwaysShow);
app.start();
}
protected void simpleInitGame() {
Sphere s = new Sphere("Sphere", 30, 30, 25);
s.setLocalTranslation(new Vector3f(0, 0, -40));
s.setModelBound(new BoundingBox());
s.updateModelBound();
}
}
Console :
30.11.2009 11:17:18 com.jme.app.BaseGame start
INFO: Application started.
30.11.2009 11:17:19 com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
30.11.2009 11:17:19 com.jme.system.PropertiesGameSettings load
INFO: Read properties
30.11.2009 11:17:26 com.jme.system.PropertiesGameSettings save
INFO: Saved properties
30.11.2009 11:17:26 com.jme.app.BaseSimpleGame initSystem
INFO: jME2 Main Trunk @ Google Code
30.11.2009 11:17:26 com.jme.input.joystick.DummyJoystickInput <init>
INFO: Joystick support is disabled
30.11.2009 11:17:26 com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
I don't know why it terminates after one second… I tried running your code and it should show an empty window until you close it (you have forgotten "rootNode.attachChild(s);" at the end, so nothing is ever drawn).
Try adding the sphere to the rootnode and see if it works. Does the examples that come with jME work?
I have never heard of a problem like this, but one thing I can think of is that you debug the application and step through what happens when you execute "createWindow". When you get to that command, press F7 (if your using netbeans) to step into functions. try to find out exacly where it crashes and which class/function it happens in and post it back here.