Package com.badlogic.gdx.backends.lwjgl3
Class Lwjgl3ApplicationConfiguration
- java.lang.Object
-
- com.badlogic.gdx.backends.lwjgl3.Lwjgl3WindowConfiguration
-
- com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration
-
public class Lwjgl3ApplicationConfiguration extends Lwjgl3WindowConfiguration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLwjgl3ApplicationConfiguration.GLEmulation
-
Field Summary
Fields Modifier and Type Field Description static java.io.PrintStreamerrorStream
-
Constructor Summary
Constructors Constructor Description Lwjgl3ApplicationConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableAudio(boolean disableAudio)Whether to disable audio or not.voidenableGLDebugOutput(boolean enable, java.io.PrintStream debugOutputStream)Enables use of OpenGL debug message callbacks.static com.badlogic.gdx.Graphics.DisplayModegetDisplayMode()static com.badlogic.gdx.Graphics.DisplayModegetDisplayMode(com.badlogic.gdx.Graphics.Monitor monitor)static com.badlogic.gdx.Graphics.DisplayMode[]getDisplayModes()static com.badlogic.gdx.Graphics.DisplayMode[]getDisplayModes(com.badlogic.gdx.Graphics.Monitor monitor)static com.badlogic.gdx.Graphics.Monitor[]getMonitors()static com.badlogic.gdx.Graphics.MonitorgetPrimaryMonitor()voidsetAudioConfig(int simultaneousSources, int bufferSize, int bufferCount)Sets the audio device configuration.voidsetBackBufferConfig(int r, int g, int b, int a, int depth, int stencil, int samples)Sets the bit depth of the color, depth and stencil buffer as well as multi-sampling.voidsetForegroundFPS(int fps)Sets the target framerate for the application.voidsetHdpiMode(com.badlogic.gdx.graphics.glutils.HdpiMode mode)Defines how HDPI monitors are handled.voidsetIdleFPS(int fps)Sets the polling rate during idle time in non-continuous rendering mode.voidsetInitialVisible(boolean visibility)voidsetMaxNetThreads(int maxNetThreads)Sets the maximum number of threads to use for network requests.voidsetOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation glVersion, int gles3MajorVersion, int gles3MinorVersion)Sets which OpenGL version to use to emulate OpenGL ES.voidsetPreferencesConfig(java.lang.String preferencesDirectory, com.badlogic.gdx.Files.FileType preferencesFileType)Sets the directory wherePreferenceswill be stored, as well as the file type to be used to store them.voidsetTransparentFramebuffer(boolean transparentFramebuffer)Set transparent window hint.-
Methods inherited from class com.badlogic.gdx.backends.lwjgl3.Lwjgl3WindowConfiguration
setAutoIconify, setDecorated, setFullscreenMode, setInitialBackgroundColor, setMaximized, setMaximizedMonitor, setResizable, setTitle, setWindowedMode, setWindowIcon, setWindowIcon, setWindowListener, setWindowPosition, setWindowSizeLimits, useVsync
-
-
-
-
Method Detail
-
setInitialVisible
public void setInitialVisible(boolean visibility)
- Overrides:
setInitialVisiblein classLwjgl3WindowConfiguration- Parameters:
visibility- whether the window will be visible on creation. (default true)
-
disableAudio
public void disableAudio(boolean disableAudio)
Whether to disable audio or not. If set to true, the returned audio class instances likeAudioorMusicwill be mock implementations.
-
setMaxNetThreads
public void setMaxNetThreads(int maxNetThreads)
Sets the maximum number of threads to use for network requests.
-
setAudioConfig
public void setAudioConfig(int simultaneousSources, int bufferSize, int bufferCount)Sets the audio device configuration.- Parameters:
simultaneousSources- the maximum number of sources that can be played simultaniously (default 16)bufferSize- the audio device buffer size in samples (default 512)bufferCount- the audio device buffer count (default 9)
-
setOpenGLEmulation
public void setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation glVersion, int gles3MajorVersion, int gles3MinorVersion)
Sets which OpenGL version to use to emulate OpenGL ES. If the given major/minor version is not supported, the backend falls back to OpenGL ES 2.0 emulation through OpenGL 2.0. The default parameters for major and minor should be 3 and 2 respectively to be compatible with Mac OS X. Specifying major version 4 and minor version 2 will ensure that all OpenGL ES 3.0 features are supported. Note however that Mac OS X does only support 3.2.- Parameters:
glVersion- which OpenGL ES emulation version to usegles3MajorVersion- OpenGL ES major version, use 3 as defaultgles3MinorVersion- OpenGL ES minor version, use 2 as default- See Also:
- LWJGL OSX ContextAttribs note
-
setBackBufferConfig
public void setBackBufferConfig(int r, int g, int b, int a, int depth, int stencil, int samples)Sets the bit depth of the color, depth and stencil buffer as well as multi-sampling.- Parameters:
r- red bits (default 8)g- green bits (default 8)b- blue bits (default 8)a- alpha bits (default 8)depth- depth bits (default 16)stencil- stencil bits (default 0)samples- MSAA samples (default 0)
-
setTransparentFramebuffer
public void setTransparentFramebuffer(boolean transparentFramebuffer)
Set transparent window hint. Results may vary on different OS and GPUs. Usage with the ANGLE backend is less consistent.- Parameters:
transparentFramebuffer-
-
setIdleFPS
public void setIdleFPS(int fps)
Sets the polling rate during idle time in non-continuous rendering mode. Must be positive. Default is 60.
-
setForegroundFPS
public void setForegroundFPS(int fps)
Sets the target framerate for the application. The CPU sleeps as needed. Must be positive. Use 0 to never sleep. Default is 0.
-
setPreferencesConfig
public void setPreferencesConfig(java.lang.String preferencesDirectory, com.badlogic.gdx.Files.FileType preferencesFileType)Sets the directory wherePreferenceswill be stored, as well as the file type to be used to store them. Defaults to "$USER_HOME/.prefs/" andFiles.FileType.External.
-
setHdpiMode
public void setHdpiMode(com.badlogic.gdx.graphics.glutils.HdpiMode mode)
Defines how HDPI monitors are handled. Operating systems may have a per-monitor HDPI scale setting. The operating system may report window width/height and mouse coordinates in a logical coordinate system at a lower resolution than the actual physical resolution. This setting allows you to specify whether you want to work in logical or raw pixel units. SeeHdpiModefor more information. Note that some OpenGL functions likeGL20.glViewport(int, int, int, int)andGL20.glScissor(int, int, int, int)require raw pixel units. UseHdpiUtilsto help with the conversion if HdpiMode is set toHdpiMode.Logical. Defaults toHdpiMode.Logical.
-
enableGLDebugOutput
public void enableGLDebugOutput(boolean enable, java.io.PrintStream debugOutputStream)Enables use of OpenGL debug message callbacks. If not supported by the core GL driver (since GL 4.3), this uses the KHR_debug, ARB_debug_output or AMD_debug_output extension if available. By default, debug messages with NOTIFICATION severity are disabled to avoid log spam. You can call withSystem.errto output to the "standard" error output stream. UseLwjgl3Application.setGLDebugMessageControl(Lwjgl3Application.GLDebugMessageSeverity, boolean)to enable or disable other severity debug levels.
-
getDisplayMode
public static com.badlogic.gdx.Graphics.DisplayMode getDisplayMode()
- Returns:
- the currently active
Graphics.DisplayModeof the primary monitor
-
getDisplayMode
public static com.badlogic.gdx.Graphics.DisplayMode getDisplayMode(com.badlogic.gdx.Graphics.Monitor monitor)
- Returns:
- the currently active
Graphics.DisplayModeof the given monitor
-
getDisplayModes
public static com.badlogic.gdx.Graphics.DisplayMode[] getDisplayModes()
- Returns:
- the available
Graphics.DisplayModes of the primary monitor
-
getDisplayModes
public static com.badlogic.gdx.Graphics.DisplayMode[] getDisplayModes(com.badlogic.gdx.Graphics.Monitor monitor)
- Returns:
- the available
Graphics.DisplayModes of the givenGraphics.Monitor
-
getPrimaryMonitor
public static com.badlogic.gdx.Graphics.Monitor getPrimaryMonitor()
- Returns:
- the primary
Graphics.Monitor
-
getMonitors
public static com.badlogic.gdx.Graphics.Monitor[] getMonitors()
- Returns:
- the connected
Graphics.Monitors
-
-