APIdia Launch Partner
Top Inners Fields Constructors Methods
com.badlogic.gdx.backends.lwjgl3

public Class Lwjgl3ApplicationConfiguration

extends Lwjgl3WindowConfiguration
Class Inheritance
Imports
java.io.PrintStream, java.nio.IntBuffer, com.badlogic.gdx.ApplicationListener, .LifecycleListener, .Audio, .Files, .Files.FileType, .Graphics.DisplayMode, .Graphics.Monitor, .Preferences, com.badlogic.gdx.utils.Os, .SharedLibraryLoader, org.lwjgl.BufferUtils, .PointerBuffer, org.lwjgl.glfw.GLFW, .GLFWVidMode, .GLFWVidMode.Buffer, org.lwjgl.system.Configuration, com.badlogic.gdx.audio.Music, com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics.Lwjgl3Monitor, com.badlogic.gdx.graphics.GL20, com.badlogic.gdx.graphics.glutils.HdpiMode, .HdpiUtils, com.badlogic.gdx.math.GridPoint2

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
pack-priv int
a

pack-priv int
pack-priv int
pack-priv int
pack-priv int
b

pack-priv boolean
pack-priv PrintStream
pack-priv int
pack-priv boolean
public static PrintStream
pack-priv int
pack-priv int
g

pack-priv Lwjgl3ApplicationConfiguration.GLEmulation
pack-priv int
pack-priv int
pack-priv HdpiMode
pack-priv int
pack-priv int
maxNetThreads

The maximum number of threads to use for network requests.

pack-priv boolean
pack-priv boolean
pack-priv String
pack-priv Files.FileType
pack-priv int
r

pack-priv int
pack-priv int
pack-priv boolean
Inherited from com.badlogic.gdx.backends.lwjgl3.Lwjgl3WindowConfiguration:
autoIconifyfullscreenModeinitialBackgroundColorinitialVisiblemaximizedMonitortitlevSyncEnabledwindowDecoratedwindowHeightwindowIconFileTypewindowIconPathswindowListenerwindowMaxHeightwindowMaximizedwindowMaxWidthwindowMinHeightwindowMinWidthwindowResizablewindowWidthwindowXwindowY

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static GridPoint2
calculateCenteredWindowPosition(Lwjgl3Graphics.Lwjgl3Monitor monitor, int newWidth, int newHeight)

pack-priv static Lwjgl3ApplicationConfiguration
public void
disableAudio(boolean disableAudio)

Whether to disable audio or not.

public void
enableGLDebugOutput(boolean enable, PrintStream debugOutputStream)

Enables use of OpenGL debug message callbacks.

public static Graphics.DisplayMode
getDisplayMode()

Returns: the currently active DisplayMode of the primary monitor

public static Graphics.DisplayMode
getDisplayMode(Graphics.Monitor monitor)

Returns: the currently active DisplayMode of the given monitor

public static Graphics.DisplayMode[]
getDisplayModes()

Returns: the available DisplayModes of the primary monitor

public static Graphics.DisplayMode[]
getDisplayModes(Graphics.Monitor monitor)

Returns: the available DisplayModes of the given Monitor

public static Graphics.Monitor[]
getMonitors()

Returns: the connected Monitors

public static Graphics.Monitor
getPrimaryMonitor()

Returns: the primary Monitor

pack-priv void
public void
setAudioConfig(int
the maximum number of sources that can be played simultaniously (default 16)
simultaneousSources
,
int
the audio device buffer size in samples (default 512)
bufferSize
,
int
the audio device buffer count (default 9)
bufferCount
)

Sets the audio device configuration.

public void
setBackBufferConfig(int
red bits (default 8)
r
,
int
green bits (default 8)
g
,
int
blue bits (default 8)
b
,
int
alpha bits (default 8)
a
,
int
depth bits (default 16)
depth
,
int
stencil bits (default 0)
stencil
,
int
MSAA samples (default 0)
samples
)

Sets the bit depth of the color, depth and stencil buffer as well as multi-sampling.

public void
setDepthBits(int
depth bits (default 16)
depth
)

Sets the bit depth of depth buffer.

public void
setForegroundFPS(int fps)

Sets the target framerate for the application.

public void
setHdpiMode(HdpiMode mode)

Defines how HDPI monitors are handled.

public void
setIdleFPS(int fps)

Sets the polling rate during idle time in non-continuous rendering mode.

public void
setInitialVisible(boolean
whether the window will be visible on creation. (default true)
visibility
)

Overrides com.badlogic.gdx.backends.lwjgl3.Lwjgl3WindowConfiguration.setInitialVisible.

public void
setMaxNetThreads(int maxNetThreads)

Sets the maximum number of threads to use for network requests.

public void
setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation
which OpenGL ES emulation version to use
glVersion
,
int
OpenGL ES major version, use 3 as default
gles3MajorVersion
,
int
OpenGL ES minor version, use 2 as default
gles3MinorVersion
)

Sets which OpenGL version to use to emulate OpenGL ES.

public void
setPauseWhenLostFocus(boolean pauseWhenLostFocus)

Sets whether to pause the application ApplicationListener#pause() and fire LifecycleListener#pause()/LifecycleListener#resume() events on when window loses/gains focus.

public void
setPauseWhenMinimized(boolean pauseWhenMinimized)

Sets whether to pause the application ApplicationListener#pause() and fire LifecycleListener#pause()/LifecycleListener#resume() events on when window is minimized/restored.

public void
setPreferencesConfig(String preferencesDirectory, Files.FileType preferencesFileType)

Sets the directory where Preferences will be stored, as well as the file type to be used to store them.

public void
setRGBABits(int
red bits (default 8)
r
,
int
green bits (default 8)
g
,
int
blue bits (default 8)
b
,
int
alpha bits (default 8)
a
)

Sets the bit depth of the color buffer.

public void
setSamples(int
MSAA samples (default 0)
samples
)

Sets the multi-sampling samples value.

public void
setStencilBits(int
stencil bits (default 0)
stencil
)

Sets the bit depth of stencil buffer.

public void
setTransparentFramebuffer(boolean transparentFramebuffer)

Set transparent window hint.

pack-priv static Lwjgl3Graphics.Lwjgl3Monitor
toLwjgl3Monitor(long glfwMonitor)

public static void
useGlfwAsync()

Whether to use the "glfw_async" library.

Inherited from com.badlogic.gdx.backends.lwjgl3.Lwjgl3WindowConfiguration:
setAutoIconifysetDecoratedsetFullscreenModesetInitialBackgroundColorsetMaximizedsetMaximizedMonitorsetResizablesetTitlesetWindowConfigurationsetWindowedModesetWindowIconsetWindowIconsetWindowListenersetWindowPositionsetWindowSizeLimitsuseVsync

Field Detail

aback to summary
pack-priv int a
audioDeviceBufferCountback to summary
pack-priv int audioDeviceBufferCount
audioDeviceBufferSizeback to summary
pack-priv int audioDeviceBufferSize
audioDeviceSimultaneousSourcesback to summary
pack-priv int audioDeviceSimultaneousSources
bback to summary
pack-priv int b
debugback to summary
pack-priv boolean debug
debugStreamback to summary
pack-priv PrintStream debugStream
depthback to summary
pack-priv int depth
disableAudioback to summary
pack-priv boolean disableAudio
errorStreamback to summary
public static PrintStream errorStream
foregroundFPSback to summary
pack-priv int foregroundFPS
gback to summary
pack-priv int g
glEmulationback to summary
pack-priv Lwjgl3ApplicationConfiguration.GLEmulation glEmulation
gles30ContextMajorVersionback to summary
pack-priv int gles30ContextMajorVersion
gles30ContextMinorVersionback to summary
pack-priv int gles30ContextMinorVersion
hdpiModeback to summary
pack-priv HdpiMode hdpiMode
idleFPSback to summary
pack-priv int idleFPS
maxNetThreadsback to summary
pack-priv int maxNetThreads

The maximum number of threads to use for network requests. Default is Integer#MAX_VALUE.

pauseWhenLostFocusback to summary
pack-priv boolean pauseWhenLostFocus
pauseWhenMinimizedback to summary
pack-priv boolean pauseWhenMinimized
preferencesDirectoryback to summary
pack-priv String preferencesDirectory
preferencesFileTypeback to summary
pack-priv Files.FileType preferencesFileType
rback to summary
pack-priv int r
samplesback to summary
pack-priv int samples
stencilback to summary
pack-priv int stencil
transparentFramebufferback to summary
pack-priv boolean transparentFramebuffer

Constructor Detail

Lwjgl3ApplicationConfigurationback to summary
public Lwjgl3ApplicationConfiguration()

Method Detail

calculateCenteredWindowPositionback to summary
pack-priv static GridPoint2 calculateCenteredWindowPosition(Lwjgl3Graphics.Lwjgl3Monitor monitor, int newWidth, int newHeight)
copyback to summary
pack-priv static Lwjgl3ApplicationConfiguration copy(Lwjgl3ApplicationConfiguration config)
disableAudioback to summary
public void disableAudio(boolean disableAudio)

Whether to disable audio or not. If set to true, the returned audio class instances like Audio or Music will be mock implementations.

enableGLDebugOutputback to summary
public void enableGLDebugOutput(boolean enable, 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 with System#err to output to the "standard" error output stream. Use Lwjgl3Application#setGLDebugMessageControl(Lwjgl3Application.GLDebugMessageSeverity, boolean) to enable or disable other severity debug levels.

getDisplayModeback to summary
public static Graphics.DisplayMode getDisplayMode()
Returns:Graphics.DisplayMode

the currently active DisplayMode of the primary monitor

getDisplayModeback to summary
public static Graphics.DisplayMode getDisplayMode(Graphics.Monitor monitor)
Returns:Graphics.DisplayMode

the currently active DisplayMode of the given monitor

getDisplayModesback to summary
public static Graphics.DisplayMode[] getDisplayModes()
Returns:Graphics.DisplayMode[]

the available DisplayModes of the primary monitor

getDisplayModesback to summary
public static Graphics.DisplayMode[] getDisplayModes(Graphics.Monitor monitor)
Returns:Graphics.DisplayMode[]

the available DisplayModes of the given Monitor

getMonitorsback to summary
public static Graphics.Monitor[] getMonitors()
Returns:Graphics.Monitor[]

the connected Monitors

getPrimaryMonitorback to summary
public static Graphics.Monitor getPrimaryMonitor()
Returns:Graphics.Monitor

the primary Monitor

setback to summary
pack-priv void set(Lwjgl3ApplicationConfiguration config)
setAudioConfigback to summary
public void setAudioConfig(int simultaneousSources, int bufferSize, int bufferCount)

Sets the audio device configuration.

Parameters
simultaneousSources:int

the maximum number of sources that can be played simultaniously (default 16)

bufferSize:int

the audio device buffer size in samples (default 512)

bufferCount:int

the audio device buffer count (default 9)

setBackBufferConfigback to summary
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:int

red bits (default 8)

g:int

green bits (default 8)

b:int

blue bits (default 8)

a:int

alpha bits (default 8)

depth:int

depth bits (default 16)

stencil:int

stencil bits (default 0)

samples:int

MSAA samples (default 0)

setDepthBitsback to summary
public void setDepthBits(int depth)

Sets the bit depth of depth buffer.

Parameters
depth:int

depth bits (default 16)

setForegroundFPSback to summary
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.

setHdpiModeback to summary
public void setHdpiMode(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. See HdpiMode for more information. Note that some OpenGL functions like GL20#glViewport(int, int, int, int) and GL20#glScissor(int, int, int, int) require raw pixel units. Use HdpiUtils to help with the conversion if HdpiMode is set to HdpiMode#Logical. Defaults to HdpiMode#Logical.

setIdleFPSback to summary
public void setIdleFPS(int fps)

Sets the polling rate during idle time in non-continuous rendering mode. Must be positive. Default is 60.

setInitialVisibleback to summary
public void setInitialVisible(boolean visibility)

Overrides com.badlogic.gdx.backends.lwjgl3.Lwjgl3WindowConfiguration.setInitialVisible.

Parameters
visibility:boolean

whether the window will be visible on creation. (default true)

setMaxNetThreadsback to summary
public void setMaxNetThreads(int maxNetThreads)

Sets the maximum number of threads to use for network requests.

setOpenGLEmulationback to summary
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:Lwjgl3ApplicationConfiguration.GLEmulation

which OpenGL ES emulation version to use

gles3MajorVersion:int

OpenGL ES major version, use 3 as default

gles3MinorVersion:int

OpenGL ES minor version, use 2 as default

See Also
LWJGL OSX ContextAttribs note
setPauseWhenLostFocusback to summary
public void setPauseWhenLostFocus(boolean pauseWhenLostFocus)

Sets whether to pause the application ApplicationListener#pause() and fire LifecycleListener#pause()/LifecycleListener#resume() events on when window loses/gains focus.

setPauseWhenMinimizedback to summary
public void setPauseWhenMinimized(boolean pauseWhenMinimized)

Sets whether to pause the application ApplicationListener#pause() and fire LifecycleListener#pause()/LifecycleListener#resume() events on when window is minimized/restored.

setPreferencesConfigback to summary
public void setPreferencesConfig(String preferencesDirectory, Files.FileType preferencesFileType)

Sets the directory where Preferences will be stored, as well as the file type to be used to store them. Defaults to "$USER_HOME/.prefs/" and FileType#External.

setRGBABitsback to summary
public void setRGBABits(int r, int g, int b, int a)

Sets the bit depth of the color buffer.

Parameters
r:int

red bits (default 8)

g:int

green bits (default 8)

b:int

blue bits (default 8)

a:int

alpha bits (default 8)

setSamplesback to summary
public void setSamples(int samples)

Sets the multi-sampling samples value.

Parameters
samples:int

MSAA samples (default 0)

setStencilBitsback to summary
public void setStencilBits(int stencil)

Sets the bit depth of stencil buffer.

Parameters
stencil:int

stencil bits (default 0)

setTransparentFramebufferback to summary
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.

toLwjgl3Monitorback to summary
pack-priv static Lwjgl3Graphics.Lwjgl3Monitor toLwjgl3Monitor(long glfwMonitor)
useGlfwAsyncback to summary
public static void useGlfwAsync()

Whether to use the "glfw_async" library. This method only does something on mac operating system. This means you do not have to set the JVM argument "-XstartOnFirstThread"

See Also
Documentation
com.badlogic.gdx.backends.lwjgl3 back to summary

public final Enum Lwjgl3ApplicationConfiguration.GLEmulation

extends Enum<Lwjgl3ApplicationConfiguration.GLEmulation>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Lwjgl3ApplicationConfiguration.GLEmulation
public static final Lwjgl3ApplicationConfiguration.GLEmulation
public static final Lwjgl3ApplicationConfiguration.GLEmulation
public static final Lwjgl3ApplicationConfiguration.GLEmulation
public static final Lwjgl3ApplicationConfiguration.GLEmulation

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Lwjgl3ApplicationConfiguration.GLEmulation
public static Lwjgl3ApplicationConfiguration.GLEmulation[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ANGLE_GLES20back to summary
public static final Lwjgl3ApplicationConfiguration.GLEmulation ANGLE_GLES20
GL20back to summary
public static final Lwjgl3ApplicationConfiguration.GLEmulation GL20
GL30back to summary
public static final Lwjgl3ApplicationConfiguration.GLEmulation GL30
GL31back to summary
public static final Lwjgl3ApplicationConfiguration.GLEmulation GL31
GL32back to summary
public static final Lwjgl3ApplicationConfiguration.GLEmulation GL32

Constructor Detail

GLEmulationback to summary
private GLEmulation()

Method Detail

valueOfback to summary
public static Lwjgl3ApplicationConfiguration.GLEmulation valueOf(String name)
valuesback to summary
public static Lwjgl3ApplicationConfiguration.GLEmulation[] values()