Class AppSettings
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
Object>
AppSettings
provides a store of configuration
to be used by the application.
By default only the context
uses the configuration,
however the user may set and retrieve the settings as well.
The settings can be stored either in the Java preferences
(using save(java.lang.String)
) or
a .properties file (using save(java.io.OutputStream)
).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.This audio renderer has too many limitations.static final String
Use the OpenAL Soft based renderer for Android audio capabilities.static final String
Use JogAmp's JOAL as the audio renderer.static final String
Use JogAmp's JOGL as the display system, with the backward compatible profilestatic final String
Use JogAmp's JOGL as the display system, with the OpenGL forward compatible profilestatic final String
Use the LWJGL OpenAL based renderer for audio capabilities.static final String
Use LWJGL as the display system and force using the OpenGL2.0 renderer.static final String
Deprecated.Previously meant 3.2, use LWJGL_OPENGL32 or LWJGL_OPENGL30static final String
Use LWJGL as the display system and force using the core OpenGL3.0 renderer.static final String
Use LWJGL as the display system and force using the core OpenGL3.1 renderer.static final String
Use LWJGL as the display system and force using the core OpenGL3.2 renderer.static final String
Use LWJGL as the display system and force using the OpenGL3.3 renderer.static final String
Deprecated.Use LWJGL_OPENGL40static final String
Use LWJGL as the display system and force using the OpenGL4.0 renderer.static final String
Use LWJGL as the display system and force using the OpenGL4.1 renderer.static final String
Use LWJGL as the display system and force using the OpenGL4.2 renderer.static final String
Use LWJGL as the display system and force using the OpenGL4.3 renderer.static final String
Use LWJGL as the display system and force using the OpenGL4.4 renderer.static final String
Use LWJGL as the display system and force using the OpenGL4.5 renderer. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
copyFrom
(AppSettings other) Copies all settings fromother
tothis
AppSettings.int
Android Only Get the number of alpha bits for the surface view to use.Get the audio rendererint
Get the bits per pixelboolean
getBoolean
(String key) Get a boolean from the settings.boolean
Tests the state of the Center Window flag.int
Get the number of depth bitsfloat
Get a float from the settings.int
Get the framerate.int
Get the frequencyint
Get the heightObject[]
getIcons()
Get the icon arrayint
getInteger
(String key) Get an integer from the settings.int
Get the heightint
Get the widthGet the rendererint
Get the number of samplesGet the settings dialog imageint
Get the number of stencil bitsGet a string from the settings.getTitle()
Get the application titleint
getWidth()
Get the widthint
Get the height of the windowint
Get the width of the windowint
Gets the window's initial X position on the desktop.int
Gets the window's initial Y position on the desktop.boolean
Returns true if keyboard emulation is enabled, false otherwise.boolean
Returns true if mouse emulation is enabled, false otherwise.boolean
boolean
boolean
Get the fullscreen stateboolean
Test whether gamma correction should be enabled.boolean
Determine if the renderer will be run in Graphics Debug mode, which means every openGL call is checked and if it returns an error code, throw aRendererException
.
Without this, many openGL calls might fail without notice, so turning it on is recommended for development.boolean
Determine if the renderer will be run in Graphics Timing mode, which means every openGL call is checked and if it runs for longer than a millisecond, log it.
It also keeps track of the time spent in GL Calls in general and displays them whenGL.resetStats()
is called.boolean
Determine if the renderer will be run in Graphics Trace mode, which means every openGL call is logged so one can trace what openGL commands where executed in which order by the engine.boolean
boolean
Determine if the display window can be resized by dragging its edges.boolean
Determine if the display context will swap buffers every frame.boolean
Determine whether to use full resolution framebuffers on Retina displays.boolean
isVSync()
Test whether vertical synchronization should be enabled.void
load
(InputStream in) Loads the settings from the given properties input stream.void
Loads settings previously saved in the Java preferences.void
mergeFrom
(AppSettings other) Same ascopyFrom(com.jme3.system.AppSettings)
, except doesn't overwrite settings that are already set.void
putBoolean
(String key, boolean value) Set a boolean on the settings.void
Set a float on the settings.void
putInteger
(String key, int value) Set an integer on the settings.void
Set a string on the settings.void
save
(OutputStream out) Saves all settings to the given properties output stream.void
Saves settings into the Java preferences.void
setAlphaBits
(int value) Android Only Sets the number of alpha bits to use.void
setAudioRenderer
(String audioRenderer) Set the audio renderer to use.void
setBitsPerPixel
(int value) Set the bits per pixel for the display.void
setCenterWindow
(boolean center) Enables or disables the Center Window flag.void
setCustomRenderer
(Class<? extends JmeContext> clazz) Set a custom graphics renderer to use.void
setDepthBits
(int value) Sets the number of depth bits to use.void
setEmulateKeyboard
(boolean emulateKeyboard) Enable or disable keyboard emulation on touchscreen based devices.void
setEmulateMouse
(boolean emulateMouse) Enable or disable mouse emulation on touchscreen based devices.void
setEmulateMouseFlipAxis
(boolean flipX, boolean flipY) Specify if the X or Y (or both) axes should be flipped for emulated mouse.void
setFrameRate
(int frameRate) void
setFrequency
(int value) Set the frequency, also known as refresh rate, for the rendering display.void
setFullscreen
(boolean value) void
setGammaCorrection
(boolean gammaCorrection) Enable or disable gamma correction.void
setGraphicsDebug
(boolean debug) Set whether the renderer will be run in Graphics Debug mode, which means every openGL call is checked and if it returns an error code, throw aRendererException
.
Without this, many openGL calls might fail without notice, so turning it on is recommended for development.void
setGraphicsTiming
(boolean timing) Set whether the renderer will be run in Graphics Timing mode, which means every openGL call is checked and if it runs for longer than a millisecond, log it.
It also keeps track of the time spent in GL Calls in general and displays them whenGL.resetStats()
is called.void
setGraphicsTrace
(boolean trace) Set whether the renderer will be run in Graphics Trace mode, which means every openGL call is logged so one can trace what openGL commands where executed in which order by the engine.void
setHeight
(int value) void
Sets the application icons to be used, with the most preferred first.void
setMinHeight
(int value) void
setMinResolution
(int width, int height) Set the minimum resolution the settings window will allow for the rendering displayvoid
setMinWidth
(int value) void
setOpenCLPlatformChooser
(Class<? extends PlatformChooser> chooser) Sets a custom platform chooser.void
setOpenCLSupport
(boolean support) True to enable the creation of an OpenCL context.void
setRenderer
(String renderer) Set the graphics renderer to use, one of:
AppSettings.LWJGL_OPENGL1 - Force OpenGL1.1 compatability AppSettings.LWJGL_OPENGL2 - Force OpenGL2 compatability AppSettings.LWJGL_OPENGL3 - Force OpenGL3.3 compatability AppSettings.LWJGL_OPENGL_ANY - Choose an appropriate OpenGL version based on system capabilities AppSettings.JOGL_OPENGL_BACKWARD_COMPATIBLE AppSettings.JOGL_OPENGL_FORWARD_COMPATIBLE null - Disable graphics renderingvoid
setResizable
(boolean resizable) Allows the display window to be resized by dragging its edges.void
setResolution
(int width, int height) Set the resolution for the default framebuffer UsesetWindowSize(int, int)
instead, for HiDPI display support.void
setSamples
(int value) Set the number of samples per pixel.void
setSettingsDialogImage
(String path) Sets the path of the settings dialog image to use.void
setStencilBits
(int value) Set the number of stencil bits.void
setStereo3D
(boolean value) Enable 3D stereo.void
setSwapBuffers
(boolean swapBuffers) When enabled the display context will swap buffers every frame.void
void
setUseInput
(boolean use) void
setUseJoysticks
(boolean use) void
setUseRetinaFrameBuffer
(boolean useRetinaFrameBuffer) Specifies whether to use full resolution framebuffers on Retina displays.void
setVSync
(boolean value) Enable or disable vertical synchronization.void
setWidth
(int value) void
setWindowSize
(int width, int height) Set the size of the windowvoid
setWindowXPosition
(int pos) Sets the window's initial X position on the desktop.void
setWindowYPosition
(int pos) Sets the window's initial Y position on the desktop.boolean
useInput()
Get the use input state.boolean
Get the use joysticks stateboolean
Get the stereo 3D stateMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
LWJGL_OPENGL2
Use LWJGL as the display system and force using the OpenGL2.0 renderer.If the underlying system does not support OpenGL2.0, then the context initialization will throw an exception.
-
LWJGL_OPENGL3
Deprecated.Previously meant 3.2, use LWJGL_OPENGL32 or LWJGL_OPENGL30Use LWJGL as the display system and force using the core OpenGL3.2 renderer.If the underlying system does not support OpenGL3.2, then the context initialization will throw an exception. Note that currently jMonkeyEngine does not have any shaders that support OpenGL3.2 therefore this option is not useful.
Note: OpenGL 3.2 is used to give 3.x support to Mac users.
-
LWJGL_OPENGL30
Use LWJGL as the display system and force using the core OpenGL3.0 renderer.If the underlying system does not support OpenGL3.0, then the context initialization will throw an exception. Note that currently jMonkeyEngine does not have any shaders that support OpenGL3.0 therefore this option is not useful.
-
LWJGL_OPENGL31
Use LWJGL as the display system and force using the core OpenGL3.1 renderer.If the underlying system does not support OpenGL3.1, then the context initialization will throw an exception. Note that currently jMonkeyEngine does not have any shaders that support OpenGL3.0 therefore this option is not useful.
-
LWJGL_OPENGL32
Use LWJGL as the display system and force using the core OpenGL3.2 renderer.If the underlying system does not support OpenGL3.2, then the context initialization will throw an exception. Note that currently jMonkeyEngine does not have any shaders that support OpenGL3.2 therefore this option is not useful.
Note: OpenGL 3.2 is used to give 3.x support to Mac users.
-
LWJGL_OPENGL33
Use LWJGL as the display system and force using the OpenGL3.3 renderer.If the underlying system does not support OpenGL3.3, then the context initialization will throw an exception.
-
LWJGL_OPENGL4
Deprecated.Use LWJGL_OPENGL40Use LWJGL as the display system and force using the OpenGL4.0 renderer.If the underlying system does not support OpenGL4.0, then the context initialization will throw an exception.
-
LWJGL_OPENGL40
Use LWJGL as the display system and force using the OpenGL4.0 renderer.If the underlying system does not support OpenGL4.0, then the context initialization will throw an exception.
-
LWJGL_OPENGL41
Use LWJGL as the display system and force using the OpenGL4.1 renderer.If the underlying system does not support OpenGL4.1, then the context initialization will throw an exception.
-
LWJGL_OPENGL42
Use LWJGL as the display system and force using the OpenGL4.2 renderer.If the underlying system does not support OpenGL4.2, then the context initialization will throw an exception.
-
LWJGL_OPENGL43
Use LWJGL as the display system and force using the OpenGL4.3 renderer.If the underlying system does not support OpenGL4.3, then the context initialization will throw an exception.
-
LWJGL_OPENGL44
Use LWJGL as the display system and force using the OpenGL4.4 renderer.If the underlying system does not support OpenGL4.4, then the context initialization will throw an exception.
-
LWJGL_OPENGL45
Use LWJGL as the display system and force using the OpenGL4.5 renderer.If the underlying system does not support OpenGL4.5, then the context initialization will throw an exception.
-
LWJGL_OPENAL
Use the LWJGL OpenAL based renderer for audio capabilities. -
ANDROID_MEDIAPLAYER
Deprecated.This audio renderer has too many limitations. useANDROID_OPENAL_SOFT
instead.Use the Android MediaPlayer / SoundPool based renderer for Android audio capabilities.NOTE: Supports Android 2.2+ platforms.
-
ANDROID_OPENAL_SOFT
Use the OpenAL Soft based renderer for Android audio capabilities.This is the current default for Android platforms. NOTE: Only to be used on Android 2.3+ platforms due to using OpenSL.
-
JOGL_OPENGL_FORWARD_COMPATIBLE
Use JogAmp's JOGL as the display system, with the OpenGL forward compatible profileN.B: This backend is EXPERIMENTAL
-
JOGL_OPENGL_BACKWARD_COMPATIBLE
Use JogAmp's JOGL as the display system, with the backward compatible profileN.B: This backend is EXPERIMENTAL
-
JOAL
Use JogAmp's JOAL as the audio renderer.N.B: This backend is EXPERIMENTAL
-
-
Constructor Details
-
AppSettings
public AppSettings(boolean loadDefaults) Create a new instance ofAppSettings
.If
loadDefaults
is true, then the default settings will be set on the AppSettings. Use false if you want to change some settings but you would like the application to load settings from previous launches.- Parameters:
loadDefaults
- If default settings are to be loaded.
-
-
Method Details
-
copyFrom
Copies all settings fromother
tothis
AppSettings.Any settings that are specified in other will overwrite settings set on this AppSettings.
- Parameters:
other
- The AppSettings to copy the settings from
-
mergeFrom
Same ascopyFrom(com.jme3.system.AppSettings)
, except doesn't overwrite settings that are already set.- Parameters:
other
- The AppSettings to merge the settings from
-
load
Loads the settings from the given properties input stream.- Parameters:
in
- The InputStream to load from- Throws:
IOException
- If an IOException occurs- See Also:
-
save
Saves all settings to the given properties output stream.- Parameters:
out
- The OutputStream to write to- Throws:
IOException
- If an IOException occurs- See Also:
-
load
Loads settings previously saved in the Java preferences.- Parameters:
preferencesKey
- The preferencesKey previously used to save the settings.- Throws:
BackingStoreException
- If an exception occurs with the preferences- See Also:
-
save
Saves settings into the Java preferences.On the Windows operating system, the preferences are saved in the registry at the following key:
HKEY_CURRENT_USER\Software\JavaSoft\Prefs\[preferencesKey]
- Parameters:
preferencesKey
- The preferences key to save at. Generally the application's unique name.- Throws:
BackingStoreException
- If an exception occurs with the preferences
-
getInteger
Get an integer from the settings.If the key is not set, then 0 is returned.
- Parameters:
key
- the key of an integer setting- Returns:
- the corresponding value, or 0 if not set
-
getBoolean
Get a boolean from the settings.If the key is not set, then false is returned.
- Parameters:
key
- the key of a boolean setting- Returns:
- the corresponding value, or false if not set
-
getString
Get a string from the settings.If the key is not set, then null is returned.
- Parameters:
key
- the key of a string setting- Returns:
- the corresponding value, or null if not set
-
getFloat
Get a float from the settings.If the key is not set, then 0.0 is returned.
- Parameters:
key
- the key of a float setting- Returns:
- the corresponding value, or 0 if not set
-
putInteger
Set an integer on the settings.- Parameters:
key
- the desired keyvalue
- the desired integer value
-
putBoolean
Set a boolean on the settings.- Parameters:
key
- the desired keyvalue
- the desired boolean value
-
putString
Set a string on the settings.- Parameters:
key
- the desired keyvalue
- the desired string value
-
putFloat
Set a float on the settings.- Parameters:
key
- the desired keyvalue
- the desired float value
-
setEmulateMouse
public void setEmulateMouse(boolean emulateMouse) Enable or disable mouse emulation on touchscreen based devices. This will convert taps on the touchscreen or movement of finger over touchscreen (only the first) into the appropriate mouse events.- Parameters:
emulateMouse
- If mouse emulation should be enabled.
-
isEmulateMouse
public boolean isEmulateMouse()Returns true if mouse emulation is enabled, false otherwise.- Returns:
- Mouse emulation mode.
-
setEmulateMouseFlipAxis
public void setEmulateMouseFlipAxis(boolean flipX, boolean flipY) Specify if the X or Y (or both) axes should be flipped for emulated mouse.- Parameters:
flipX
- Set to flip X axisflipY
- Set to flip Y axis- See Also:
-
isEmulateMouseFlipX
public boolean isEmulateMouseFlipX() -
isEmulateMouseFlipY
public boolean isEmulateMouseFlipY() -
setEmulateKeyboard
public void setEmulateKeyboard(boolean emulateKeyboard) Enable or disable keyboard emulation on touchscreen based devices. This will convert soft keyboard key presses on the touchscreen into the appropriate key events.- Parameters:
emulateKeyboard
- If soft keyboard emulation should be enabled.
-
isEmulateKeyboard
public boolean isEmulateKeyboard()Returns true if keyboard emulation is enabled, false otherwise.- Returns:
- Soft keyboard emulation mode.
-
setFrameRate
public void setFrameRate(int frameRate) - Parameters:
frameRate
- The frame-rate is the upper limit on how high the application's frames-per-second can go. (Default: -1 no frame rate limit imposed)
-
setUseInput
public void setUseInput(boolean use) - Parameters:
use
- If true, the application will initialize and use input. Set to false for headless applications that do not require keyboard or mouse input. (Default: true)
-
setUseJoysticks
public void setUseJoysticks(boolean use) - Parameters:
use
- If true, the application will initialize and use joystick input. Set to false if no joystick input is desired. (Default: false)
-
setRenderer
Set the graphics renderer to use, one of:
- AppSettings.LWJGL_OPENGL1 - Force OpenGL1.1 compatability
- AppSettings.LWJGL_OPENGL2 - Force OpenGL2 compatability
- AppSettings.LWJGL_OPENGL3 - Force OpenGL3.3 compatability
- AppSettings.LWJGL_OPENGL_ANY - Choose an appropriate OpenGL version based on system capabilities
- AppSettings.JOGL_OPENGL_BACKWARD_COMPATIBLE
- AppSettings.JOGL_OPENGL_FORWARD_COMPATIBLE
- null - Disable graphics rendering
- Parameters:
renderer
- The renderer to set (Default: AppSettings.LWJGL_OPENGL32)
-
setCustomRenderer
Set a custom graphics renderer to use. The class should implement theJmeContext
interface.- Parameters:
clazz
- The custom context class. (Default: not set)
-
setAudioRenderer
Set the audio renderer to use. One of:
- AppSettings.LWJGL_OPENAL - Default for LWJGL
- AppSettings.JOAL
- null - Disable audio
- Parameters:
audioRenderer
- (Default: LWJGL)
-
setWidth
public void setWidth(int value) - Parameters:
value
- the width for the default framebuffer. (Default: 640)
-
setHeight
public void setHeight(int value) - Parameters:
value
- the height for the default framebuffer. (Default: 480)
-
setResolution
public void setResolution(int width, int height) Set the resolution for the default framebuffer UsesetWindowSize(int, int)
instead, for HiDPI display support.- Parameters:
width
- The widthheight
- The height (Default: 640x480)
-
setWindowSize
public void setWindowSize(int width, int height) Set the size of the window- Parameters:
width
- The width in pixels (default = width of the default framebuffer)height
- The height in pixels (default = height of the default framebuffer)
-
setMinWidth
public void setMinWidth(int value) - Parameters:
value
- the minimum width the settings window will allow for the rendering display. (Default: 0)
-
setMinHeight
public void setMinHeight(int value) - Parameters:
value
- the minimum height the settings window will allow for the rendering display. (Default: 0)
-
setMinResolution
public void setMinResolution(int width, int height) Set the minimum resolution the settings window will allow for the rendering display- Parameters:
width
- The minimum widthheight
- The minimum height (Default: 0x0)
-
setFrequency
public void setFrequency(int value) Set the frequency, also known as refresh rate, for the rendering display.- Parameters:
value
- The frequency (Default: 60)
-
setDepthBits
public void setDepthBits(int value) Sets the number of depth bits to use.The number of depth bits specifies the precision of the depth buffer. To increase precision, specify 32 bits. To decrease precision, specify 16 bits. On some platforms 24 bits might not be supported, in that case, specify 16 bits.
(Default: 24)
- Parameters:
value
- The depth bits
-
setAlphaBits
public void setAlphaBits(int value) Android Only Sets the number of alpha bits to use.The number of alpha bits specifies the precision of the surface view background alpha value. To set the surface view to opaque (fastest setting), leave the number of alpha bits = 0. This will cause faster rendering, but android views located behind the surface view will not be viewable. To set the surface view to translucent, set the number of alphaBits to 8 or higher. Values less than 8 (except 0) will set the surface view pixel format to transparent.
(Default: 0)
- Parameters:
value
- The alpha bits
-
setStencilBits
public void setStencilBits(int value) Set the number of stencil bits.This value is only relevant when the stencil buffer is being used. Specify 8 to indicate an 8-bit stencil buffer, specify 0 to disable the stencil buffer.
(Default: 0)- Parameters:
value
- Number of stencil bits
-
setBitsPerPixel
public void setBitsPerPixel(int value) Set the bits per pixel for the display. Appropriate values are 16 for RGB565 color format, or 24 for RGB8 color format.- Parameters:
value
- The bits per pixel to set (Default: 24)
-
setSamples
public void setSamples(int value) Set the number of samples per pixel. A value of 1 indicates each pixel should be single-sampled, higher values indicate a pixel should be multi-sampled.- Parameters:
value
- The number of samples (Default: 1)
-
setTitle
- Parameters:
title
- The title of the rendering display (Default: jMonkeyEngine 3.0)
-
setFullscreen
public void setFullscreen(boolean value) - Parameters:
value
- true to enable full-screen rendering, false to render in a window (Default: false)
-
setVSync
public void setVSync(boolean value) Enable or disable vertical synchronization. If enabled, rendering will be synchronized with the display's refresh interval.- Parameters:
value
- true to enable, false to disable (Default : true)
-
setStereo3D
public void setStereo3D(boolean value) Enable 3D stereo.This feature requires hardware support from the GPU driver. See http://en.wikipedia.org/wiki/Quad_buffering
Once enabled, filters or scene processors that handle 3D stereo rendering could use this feature to render using hardware 3D stereo.- Parameters:
value
- true to enable 3-D stereo, false to disable (default=false)
-
setIcons
Sets the application icons to be used, with the most preferred first. For Windows, you should supply at least one 16x16 icon and one 32x32. The former is used for the title/task bar, the latter for the alt-tab icon. Linux (and similar platforms) expect one 32x32 icon. Mac OS X should be supplied one 128x128 icon.
The icon is used for the settings window, and the LWJGL render window. Note that a bug in Java 6 (bug ID 6445278, currently hidden but available in Google cache) currently prevents the icon working for alt-tab on the settings dialog in Windows.- Parameters:
value
- An array of BufferedImages to use as icons. (Default: not set)
-
setSettingsDialogImage
Sets the path of the settings dialog image to use.The image will be displayed in the settings dialog when the application is started.
(Default: /com/jme3/app/Monkey.png)- Parameters:
path
- The path to the image in the classpath.
-
setGammaCorrection
public void setGammaCorrection(boolean gammaCorrection) Enable or disable gamma correction. If enabled, the main framebuffer will be configured for sRGB colors, and sRGB images will be linearized. Gamma correction requires a GPU that supports GL_ARB_framebuffer_sRGB; otherwise this setting will be ignored.- Parameters:
gammaCorrection
- true to enable, false to disable (Default : true)
-
getFrameRate
public int getFrameRate()Get the framerate.- Returns:
- the maximum rate (in frames per second), or -1 for unlimited
- See Also:
-
useInput
public boolean useInput()Get the use input state.- Returns:
- true if input is enabled, false if it's disabled
- See Also:
-
getRenderer
Get the renderer- Returns:
- the graphics renderer's name and version, for example "LWJGL-OpenGL33"
- See Also:
-
getWidth
public int getWidth()Get the width- Returns:
- the width of the default framebuffer (in pixels)
- See Also:
-
getHeight
public int getHeight()Get the height- Returns:
- the height of the default framebuffer (in pixels)
- See Also:
-
getWindowWidth
public int getWindowWidth()Get the width of the window- Returns:
- the width of the window (in pixels)
- See Also:
-
getWindowHeight
public int getWindowHeight()Get the height of the window- Returns:
- the height of the window (in pixels)
- See Also:
-
getMinWidth
public int getMinWidth()Get the width- Returns:
- the minimum width for the rendering display (in pixels)
- See Also:
-
getMinHeight
public int getMinHeight()Get the height- Returns:
- the minimum height for the rendering display (in pixels)
- See Also:
-
getBitsPerPixel
public int getBitsPerPixel()Get the bits per pixel- Returns:
- the number of color bits per rendered pixel
- See Also:
-
getFrequency
public int getFrequency()Get the frequency- Returns:
- the refresh rate of the (full-screen) display (in Hertz)
- See Also:
-
getDepthBits
public int getDepthBits()Get the number of depth bits- Returns:
- the number of depth bits per rendered pixel
- See Also:
-
getAlphaBits
public int getAlphaBits()Android Only Get the number of alpha bits for the surface view to use.- Returns:
- the number of alpha bits per rendered pixel
- See Also:
-
getStencilBits
public int getStencilBits()Get the number of stencil bits- Returns:
- the number of stencil bits per rendered pixel
- See Also:
-
getSamples
public int getSamples()Get the number of samples- Returns:
- the number of samples per pixel (for multisample anti-aliasing)
- See Also:
-
getTitle
Get the application title- Returns:
- the title text
- See Also:
-
isVSync
public boolean isVSync()Test whether vertical synchronization should be enabled.- Returns:
- true for enabled, false for disabled
- See Also:
-
isFullscreen
public boolean isFullscreen()Get the fullscreen state- Returns:
- true for fullscreen display, false for windowed display
- See Also:
-
useJoysticks
public boolean useJoysticks()Get the use joysticks state- Returns:
- true to enable joystick input, false to disable it
- See Also:
-
getAudioRenderer
Get the audio renderer- Returns:
- the audio renderer's name, for example "LWJGL"
- See Also:
-
useStereo3D
public boolean useStereo3D()Get the stereo 3D state- Returns:
- true if 3-D stereo is enabled, otherwise false
- See Also:
-
getIcons
Get the icon array- Returns:
- the pre-existing array
- See Also:
-
getSettingsDialogImage
Get the settings dialog image- Returns:
- a path to the image asset
- See Also:
-
isGammaCorrection
public boolean isGammaCorrection()Test whether gamma correction should be enabled.- Returns:
- true for enabled, false for disabled
-
setResizable
public void setResizable(boolean resizable) Allows the display window to be resized by dragging its edges. Only supported forJmeContext.Type.Display
contexts which are in windowed mode, ignored for other types. The default value isfalse
.- Parameters:
resizable
- True to make a resizable window, false to make a fixed size window.
-
isResizable
public boolean isResizable()Determine if the display window can be resized by dragging its edges.- Returns:
- True if the window is resizable, false if it is fixed size.
- See Also:
-
setSwapBuffers
public void setSwapBuffers(boolean swapBuffers) When enabled the display context will swap buffers every frame. This may need to be disabled when integrating with an external library that handles buffer swapping on its own, e.g. Oculus Rift. When disabled, the engine will process window messages after each frame, but it will not swap buffers. Note that this will cause 100% CPU usage normally as there's no VSync or any framerate caps (unless set viasetFrameRate(int)
). The default istrue
.- Parameters:
swapBuffers
- True to enable buffer swapping, false to disable it.
-
isSwapBuffers
public boolean isSwapBuffers()Determine if the display context will swap buffers every frame.- Returns:
- True if buffer swapping is enabled, false otherwise.
- See Also:
-
setOpenCLSupport
public void setOpenCLSupport(boolean support) True to enable the creation of an OpenCL context.- Parameters:
support
- whether to create the context or not
-
isOpenCLSupport
public boolean isOpenCLSupport() -
setOpenCLPlatformChooser
Sets a custom platform chooser. This chooser specifies which platform and which devices are used for the OpenCL context. Default: an implementation defined one.- Parameters:
chooser
- the class of the chooser, must have a default constructor
-
getOpenCLPlatformChooser
-
isGraphicsDebug
public boolean isGraphicsDebug()Determine if the renderer will be run in Graphics Debug mode, which means every openGL call is checked and if it returns an error code, throw aRendererException
.
Without this, many openGL calls might fail without notice, so turning it on is recommended for development. Graphics Debug mode will also label native objects and group calls on supported renderers. Compatible graphics debuggers will be able to use this data to show a better outlook of your application- Returns:
- whether the context will be run in Graphics Debug Mode or not
- See Also:
-
setGraphicsDebug
public void setGraphicsDebug(boolean debug) Set whether the renderer will be run in Graphics Debug mode, which means every openGL call is checked and if it returns an error code, throw aRendererException
.
Without this, many openGL calls might fail without notice, so turning it on is recommended for development. Graphics Debug mode will also label native objects and group calls on supported renderers. Compatible graphics debuggers will be able to use this data to show a better outlook of your application- Parameters:
debug
- whether the context will be run in Graphics Debug Mode or not- See Also:
-
isGraphicsTiming
public boolean isGraphicsTiming()Determine if the renderer will be run in Graphics Timing mode, which means every openGL call is checked and if it runs for longer than a millisecond, log it.
It also keeps track of the time spent in GL Calls in general and displays them whenGL.resetStats()
is called.- Returns:
- whether the context will be run in Graphics Timing Mode or not
- See Also:
-
setGraphicsTiming
public void setGraphicsTiming(boolean timing) Set whether the renderer will be run in Graphics Timing mode, which means every openGL call is checked and if it runs for longer than a millisecond, log it.
It also keeps track of the time spent in GL Calls in general and displays them whenGL.resetStats()
is called.- Parameters:
timing
- whether the context will be run in Graphics Timing Mode or not- See Also:
-
isGraphicsTrace
public boolean isGraphicsTrace()Determine if the renderer will be run in Graphics Trace mode, which means every openGL call is logged so one can trace what openGL commands where executed in which order by the engine.- Returns:
- whether the context will be run in Graphics Trace Mode or not
- See Also:
-
setGraphicsTrace
public void setGraphicsTrace(boolean trace) Set whether the renderer will be run in Graphics Trace mode, which means every openGL call is logged so one can trace what openGL commands where executed in which order by the engine.- Parameters:
trace
- whether the context will be run in Graphics Trace Mode or not- See Also:
-
isUseRetinaFrameBuffer
public boolean isUseRetinaFrameBuffer()Determine whether to use full resolution framebuffers on Retina displays.- Returns:
- whether to use full resolution framebuffers on Retina displays.
-
setUseRetinaFrameBuffer
public void setUseRetinaFrameBuffer(boolean useRetinaFrameBuffer) Specifies whether to use full resolution framebuffers on Retina displays. This is ignored on other platforms.- Parameters:
useRetinaFrameBuffer
- whether to use full resolution framebuffers on Retina displays.
-
getCenterWindow
public boolean getCenterWindow()Tests the state of the Center Window flag.The Center Window flag is used only with LWJGL3 and has no effect on fullscreen windows.
- Returns:
- true to center the window on the desktop, false to position the window at (WindowXPosition, WindowYPosition)
- See Also:
-
setCenterWindow
public void setCenterWindow(boolean center) Enables or disables the Center Window flag.The Center Window flag is used only with LWJGL3 and has no effect on fullscreen windows. It defaults to true.
- Parameters:
center
- true to center the window on the desktop, false to position the window at (WindowXPosition, WindowYPosition)
-
getWindowXPosition
public int getWindowXPosition()Gets the window's initial X position on the desktop.This setting is used only with LWJGL3, has no effect on fullscreen windows, and is ignored if the Center Window flag is true.
- Returns:
- the initial position of the window's left edge relative to the left edge of the desktop
- See Also:
-
setWindowXPosition
public void setWindowXPosition(int pos) Sets the window's initial X position on the desktop.This setting is used only with LWJGL3, has no effect on fullscreen windows, and is ignored if the Center Window flag is true. Its default value is 0.
- Parameters:
pos
- the desired initial position of the window's left edge relative to the left edge of the desktop- See Also:
-
getWindowYPosition
public int getWindowYPosition()Gets the window's initial Y position on the desktop.This setting is used only with LWJGL3, has no effect on fullscreen windows, and is ignored if the Center Window flag is true.
- Returns:
- the initial position of the window's upper edge relative to the upper edge of the desktop
- See Also:
-
setWindowYPosition
public void setWindowYPosition(int pos) Sets the window's initial Y position on the desktop.This setting is used only with LWJGL3, has no effect on fullscreen windows, and is ignored if the Center Window flag is true. Its default value is 0.
- Parameters:
pos
- the desired initial position of the window's upper edge relative to the upper edge of the desktop- See Also:
-