Every jMonkeyEngine game has a so-called context type. The context type specifies whether the game opens an OpenGL window, renders on a canvas, or runs "headless"—without drawing anything to the screen.
You switch the context type in your
main()
method when youapp.start()
the application:public static void main(String[] args) { AppSettings settings = new AppSettings(true); settings.setTitle("My Cool Game"); SettingsTest app = new SettingsTest(); app.setSettings(settings); app.start(JmeContext.Type.Headless); // switch context type }
Run this code.
The game loop executes in a so-called headless context; this means no video is rendered. We'll look at examples where you would switch context types.