APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.backends.lwjgl

public Class LwjglApplication

extends Object
implements LwjglApplicationBase
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.backends.lwjgl.LwjglApplicationBase, com.badlogic.gdx.Application
Known Direct Subclasses
com.badlogic.gdx.backends.lwjgl.LwjglApplet.LwjglAppletApplication
Imports
java.io.File, com.badlogic.gdx.backends.lwjgl.audio.LwjglAudio, .OpenALLwjglAudio, org.lwjgl.LWJGLException, org.lwjgl.opengl.Display, com.badlogic.gdx.ApplicationListener, .ApplicationLogger, .Audio, .Files, .Gdx, .Input, .LifecycleListener, .Net, .Preferences, com.badlogic.gdx.utils.Array, .Clipboard, .GdxRuntimeException, .ObjectMap, .SnapshotArray, java.awt.Canvas

An OpenGL surface fullscreen or in a lightweight window.

Field Summary

Modifier and TypeField and Description
protected ApplicationLogger
protected LwjglAudio
protected final Array<Runnable>
protected final Files
protected final LwjglGraphics
protected final LwjglInput
protected final SnapshotArray<LifecycleListener>
protected final ApplicationListener
protected int
protected Thread
protected final LwjglNet
pack-priv ObjectMap<String, Preferences>
protected String
protected Files.FileType
protected final Array<Runnable>
protected boolean

Constructor Summary

AccessConstructor and Description
public
LwjglApplication(ApplicationListener listener, String title, int width, int height)

public
public
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
public LwjglAudio
private static LwjglApplicationConfiguration
createConfig(String title, int width, int height)

protected Files
public LwjglInput
public void
debug(String tag, String message)

Implements com.badlogic.gdx.Application.debug.

Logs a debug message to the console or logcat

public void
debug(String tag, String message, Throwable exception)

Implements com.badlogic.gdx.Application.debug.

Logs a debug message to the console or logcat

public void
error(String tag, String message)

Implements com.badlogic.gdx.Application.error.

Logs an error message to the console or logcat

public void
error(String tag, String message, Throwable exception)

Implements com.badlogic.gdx.Application.error.

Logs an error message to the console or logcat

public boolean
public void
exit()

Implements com.badlogic.gdx.Application.exit.

Schedule an exit from the application.

public ApplicationListener
public ApplicationLogger
public Audio
public Clipboard
public Files
public LwjglGraphics
public Input
public long
public int
getLogLevel()

Implements com.badlogic.gdx.Application.getLogLevel.

Gets the log level.

public long
public Net
public Preferences
getPreferences(String name)

Implements com.badlogic.gdx.Application.getPreferences.

Returns the Preferences instance of this Application.

public Application.ApplicationType
public int
private void
public void
log(String tag, String message)

Implements com.badlogic.gdx.Application.log.

Logs a message to the console or logcat

public void
log(String tag, String message, Throwable exception)

Implements com.badlogic.gdx.Application.log.

Logs a message to the console or logcat

protected void
public void
postRunnable(Runnable runnable)

Implements com.badlogic.gdx.Application.postRunnable.

Posts a Runnable on the main loop thread.

public void
public void
setApplicationLogger(ApplicationLogger applicationLogger)

Implements com.badlogic.gdx.Application.setApplicationLogger.

Sets the current Application logger.

public void
setLogLevel(int logLevel)

Implements com.badlogic.gdx.Application.setLogLevel.

Sets the log level.

public void
stop()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

applicationLoggerback to summary
protected ApplicationLogger applicationLogger
audioback to summary
protected LwjglAudio audio
executedRunnablesback to summary
protected final Array<Runnable> executedRunnables
filesback to summary
protected final Files files
graphicsback to summary
protected final LwjglGraphics graphics
inputback to summary
protected final LwjglInput input
lifecycleListenersback to summary
protected final SnapshotArray<LifecycleListener> lifecycleListeners
listenerback to summary
protected final ApplicationListener listener
logLevelback to summary
protected int logLevel
mainLoopThreadback to summary
protected Thread mainLoopThread
netback to summary
protected final LwjglNet net
preferencesback to summary
pack-priv ObjectMap<String, Preferences> preferences
preferencesdirback to summary
protected String preferencesdir
preferencesFileTypeback to summary
protected Files.FileType preferencesFileType
runnablesback to summary
protected final Array<Runnable> runnables
runningback to summary
protected boolean running

Constructor Detail

LwjglApplicationback to summary
public LwjglApplication(ApplicationListener listener, String title, int width, int height)
LwjglApplicationback to summary
public LwjglApplication(ApplicationListener listener)
LwjglApplicationback to summary
public LwjglApplication(ApplicationListener listener, LwjglApplicationConfiguration config)
LwjglApplicationback to summary
public LwjglApplication(ApplicationListener listener, Canvas canvas)
LwjglApplicationback to summary
public LwjglApplication(ApplicationListener listener, LwjglApplicationConfiguration config, Canvas canvas)
LwjglApplicationback to summary
public LwjglApplication(ApplicationListener listener, LwjglApplicationConfiguration config, LwjglGraphics graphics)

Method Detail

addLifecycleListenerback to summary
public void addLifecycleListener(LifecycleListener listener)

Implements com.badlogic.gdx.Application.addLifecycleListener.

Doc from com.badlogic.gdx.Application.addLifecycleListener.

Adds a new LifecycleListener to the application. This can be used by extensions to hook into the lifecycle more easily. The ApplicationListener methods are sufficient for application level development.

Annotations
@Override
createAudioback to summary
public LwjglAudio createAudio(LwjglApplicationConfiguration config)

Implements com.badlogic.gdx.backends.lwjgl.LwjglApplicationBase.createAudio.

Annotations
@Override
createConfigback to summary
private static LwjglApplicationConfiguration createConfig(String title, int width, int height)
createFilesback to summary
protected Files createFiles()
createInputback to summary
public LwjglInput createInput(LwjglApplicationConfiguration config)

Implements com.badlogic.gdx.backends.lwjgl.LwjglApplicationBase.createInput.

Annotations
@Override
debugback to summary
public void debug(String tag, String message)

Implements com.badlogic.gdx.Application.debug.

Doc from com.badlogic.gdx.Application.debug.

Logs a debug message to the console or logcat

Annotations
@Override
debugback to summary
public void debug(String tag, String message, Throwable exception)

Implements com.badlogic.gdx.Application.debug.

Doc from com.badlogic.gdx.Application.debug.

Logs a debug message to the console or logcat

Annotations
@Override
errorback to summary
public void error(String tag, String message)

Implements com.badlogic.gdx.Application.error.

Doc from com.badlogic.gdx.Application.error.

Logs an error message to the console or logcat

Annotations
@Override
errorback to summary
public void error(String tag, String message, Throwable exception)

Implements com.badlogic.gdx.Application.error.

Doc from com.badlogic.gdx.Application.error.

Logs an error message to the console or logcat

Annotations
@Override
executeRunnablesback to summary
public boolean executeRunnables()
exitback to summary
public void exit()

Implements com.badlogic.gdx.Application.exit.

Doc from com.badlogic.gdx.Application.exit.

Schedule an exit from the application. On android, this will cause a call to pause() and dispose() some time in the future, it will not immediately finish your application. On iOS this should be avoided in production as it breaks Apples guidelines

Annotations
@Override
getApplicationListenerback to summary
public ApplicationListener getApplicationListener()

Implements com.badlogic.gdx.Application.getApplicationListener.

Annotations
@Override
getApplicationLoggerback to summary
public ApplicationLogger getApplicationLogger()

Implements com.badlogic.gdx.Application.getApplicationLogger.

Annotations
@Override
getAudioback to summary
public Audio getAudio()

Implements com.badlogic.gdx.Application.getAudio.

Annotations
@Override
getClipboardback to summary
public Clipboard getClipboard()

Implements com.badlogic.gdx.Application.getClipboard.

Annotations
@Override
getFilesback to summary
public Files getFiles()

Implements com.badlogic.gdx.Application.getFiles.

Annotations
@Override
getGraphicsback to summary
public LwjglGraphics getGraphics()

Implements com.badlogic.gdx.Application.getGraphics.

Annotations
@Override
getInputback to summary
public Input getInput()

Implements com.badlogic.gdx.Application.getInput.

Annotations
@Override
getJavaHeapback to summary
public long getJavaHeap()

Implements com.badlogic.gdx.Application.getJavaHeap.

Annotations
@Override
getLogLevelback to summary
public int getLogLevel()

Implements com.badlogic.gdx.Application.getLogLevel.

Doc from com.badlogic.gdx.Application.getLogLevel.

Gets the log level.

Annotations
@Override
getNativeHeapback to summary
public long getNativeHeap()

Implements com.badlogic.gdx.Application.getNativeHeap.

Annotations
@Override
getNetback to summary
public Net getNet()

Implements com.badlogic.gdx.Application.getNet.

Annotations
@Override
getPreferencesback to summary
public Preferences getPreferences(String name)

Implements com.badlogic.gdx.Application.getPreferences.

Doc from com.badlogic.gdx.Application.getPreferences.

Returns the Preferences instance of this Application. It can be used to store application settings across runs.

Annotations
@Override
getTypeback to summary
public Application.ApplicationType getType()

Implements com.badlogic.gdx.Application.getType.

Annotations
@Override
getVersionback to summary
public int getVersion()

Implements com.badlogic.gdx.Application.getVersion.

Annotations
@Override
initializeback to summary
private void initialize()
logback to summary
public void log(String tag, String message)

Implements com.badlogic.gdx.Application.log.

Doc from com.badlogic.gdx.Application.log.

Logs a message to the console or logcat

Annotations
@Override
logback to summary
public void log(String tag, String message, Throwable exception)

Implements com.badlogic.gdx.Application.log.

Doc from com.badlogic.gdx.Application.log.

Logs a message to the console or logcat

Annotations
@Override
mainLoopback to summary
protected void mainLoop()
postRunnableback to summary
public void postRunnable(Runnable runnable)

Implements com.badlogic.gdx.Application.postRunnable.

Doc from com.badlogic.gdx.Application.postRunnable.

Posts a Runnable on the main loop thread. In a multi-window application, the Gdx#graphics and Gdx#input values may be unpredictable at the time the Runnable is executed. If graphics or input are needed, they can be copied to a variable to be used in the Runnable. For example:

final Graphics graphics = Gdx.graphics;

Annotations
@Override
removeLifecycleListenerback to summary
public void removeLifecycleListener(LifecycleListener listener)

Implements com.badlogic.gdx.Application.removeLifecycleListener.

Doc from com.badlogic.gdx.Application.removeLifecycleListener.

Removes the LifecycleListener.

Annotations
@Override
setApplicationLoggerback to summary
public void setApplicationLogger(ApplicationLogger applicationLogger)

Implements com.badlogic.gdx.Application.setApplicationLogger.

Doc from com.badlogic.gdx.Application.setApplicationLogger.

Sets the current Application logger. Calls to log(String, String) are delegated to this ApplicationLogger

Annotations
@Override
setLogLevelback to summary
public void setLogLevel(int logLevel)

Implements com.badlogic.gdx.Application.setLogLevel.

Doc from com.badlogic.gdx.Application.setLogLevel.

Sets the log level. LOG_NONE will mute all log output. LOG_ERROR will only let error messages through. LOG_INFO will let all non-debug messages through, and LOG_DEBUG will let all messages through.

Annotations
@Override
stopback to summary
public void stop()