jME3 Application Display Settings

Every class that extends jme3.app.Application (or jme3.app.SimpleApplication) has properties that can be configured by customizing a com.jme3.system.AppSettings object. Configure the settings before you call app.start() on the application object. If you change display settings during runtime, call app.restart() to make them take effect.

Note: Other runtime settings are covered in SimpleApplication.

Code Sample

AppSettings settings = new AppSettings(true);
settings.setRenderer(AppSettings.LWJGL_OPENGL3);
Application app = new Application();
app.setSettings(settings);
app.start();

Set the boolean in the AppSettings contructor to true if you want to keep the default settings for everything that you do not specify. Set this parameter to false if you want to specify each property yourself (you'll get an exception if you missed one).

Use app.setShowSettings(false); to disable the default settings-window at startup.

Properties

PropertyDscriptionDefault
setRenderer(AppSettings.LWJGL_OPENGL2)
setRenderer(AppSettings.LWJGL_OPENGL3)
Switch Video RendererOpenGL 2
setAudioRenderer(AppSettings.LWJGL_OPENAL)
setAudioRenderer(AppSettings.LWJGL_JOAL)
Switch Audio RendererOpenAL
setBitsPerPixel(8)Set color depth.
1 = black and white, 2 bit = gray,
4 = 16 colors, 8 = 256 colors, 24 or 32 = "truecolor".
24
setFrequency(60)The screen frequency (refresh rate of the graphics card), usually 60 or 75 fps.60 fps
setFramerate(60)How often per second the engine should try to refresh the frame. For the release, usually 60 fps. Can be lower (59-30) for FX-intensive games. Do not set to a higher value than the screen frequency.-1 (auto)
setFullscreen(true)Set this to true to make the display fill the whole screen; you need to provide a key that calls app.stop() to exit the fullscreen view gracefully (default: escape).
Set it to false to play the game in a normal window of its own.
False (windowed)
setHeight(480), setWidth(640)
setResolution(640,480)
Two equivalent ways of setting the display resolution.640x480 pixels
setSamples(4)Set multisampling to 0 to switch antialiasing off (harder edges, faster.)
Set multisampling to 2 or 4 to activate antialising (softer edges, may be slower.)
Depending on your graphic card, you may be able to go set multisampling to 8, 16, or 32 samples.
0
setVSync(true)Set vertical syncing to true to time the frame buffer to coincide with the refresh interval of the screen: Prevents page tearing, but slower; recommened for release.
Set to false to deactivate vertical syncing (faster, but possible page tearing artifacts); can be deactivated during development.
false
useInput(false)Respond to user input by mouse and keyboard. Can be deactivated for use cases where you only display a 3D scene on the canvas without any interaction.true
useJoysticks(true)Activate optional joystick supportfalse
setSettingsDialogImage("/path/in/assets.png")A custom image to display when the settings dialog is shown."/com/jme3/app/Monkey.png"
setTitle("My Game")This string will be visible in the titlebar, unless the window is fullscreen."jMonkey Engine 3.0"

Methods

An AppSettings object also supports the following methods:

view online version