libgdx API

com.badlogic.gdx.backends.lwjgl
Class LwjglApplication

java.lang.Object
  extended by com.badlogic.gdx.backends.lwjgl.LwjglApplication
All Implemented Interfaces:
Application

public class LwjglApplication
extends java.lang.Object
implements Application

An OpenGL surface fullscreen or in a lightweight window.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.badlogic.gdx.Application
Application.ApplicationType
 
Field Summary
protected  OpenALAudio audio
           
protected  Array<java.lang.Runnable> executedRunnables
           
protected  LwjglFiles files
           
protected  LwjglGraphics graphics
           
protected  LwjglInput input
           
protected  Array<LifecycleListener> lifecycleListeners
           
protected  ApplicationListener listener
           
protected  int logLevel
           
protected  java.lang.Thread mainLoopThread
           
protected  LwjglNet net
           
protected  Array<java.lang.Runnable> runnables
           
protected  boolean running
           
 
Fields inherited from interface com.badlogic.gdx.Application
LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_NONE
 
Constructor Summary
LwjglApplication(ApplicationListener listener)
           
LwjglApplication(ApplicationListener listener, boolean useGL2, java.awt.Canvas canvas)
           
LwjglApplication(ApplicationListener listener, LwjglApplicationConfiguration config)
           
LwjglApplication(ApplicationListener listener, LwjglApplicationConfiguration config, java.awt.Canvas canvas)
           
LwjglApplication(ApplicationListener listener, LwjglApplicationConfiguration config, LwjglGraphics graphics)
           
LwjglApplication(ApplicationListener listener, java.lang.String title, int width, int height, boolean useGL2)
           
 
Method Summary
 void addLifecycleListener(LifecycleListener listener)
          Adds a new LifecycleListener to the application.
 void debug(java.lang.String tag, java.lang.String message)
          Logs a debug message to the console or logcat
 void debug(java.lang.String tag, java.lang.String message, java.lang.Throwable exception)
          Logs a debug message to the console or logcat
 void error(java.lang.String tag, java.lang.String message)
          Logs an error message to the console or logcat
 void error(java.lang.String tag, java.lang.String message, java.lang.Throwable exception)
          Logs an error message to the console or logcat
 void exit()
          Exits the application.
 Audio getAudio()
           
 Clipboard getClipboard()
           
 Files getFiles()
           
 LwjglGraphics getGraphics()
           
 Input getInput()
           
 long getJavaHeap()
           
 long getNativeHeap()
           
 Net getNet()
           
 Preferences getPreferences(java.lang.String name)
          Returns the Preferences instance of this Application.
 Application.ApplicationType getType()
           
 int getVersion()
           
 void log(java.lang.String tag, java.lang.String message)
          Logs a message to the console or logcat
 void log(java.lang.String tag, java.lang.String message, java.lang.Exception exception)
          Logs a message to the console or logcat
 void postRunnable(java.lang.Runnable runnable)
          Posts a Runnable on the main loop thread.
 void removeLifecycleListener(LifecycleListener listener)
          Removes the LifecycleListener.
 void setLogLevel(int logLevel)
          Sets the log level.
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graphics

protected final LwjglGraphics graphics

audio

protected OpenALAudio audio

files

protected final LwjglFiles files

input

protected final LwjglInput input

net

protected final LwjglNet net

listener

protected final ApplicationListener listener

mainLoopThread

protected java.lang.Thread mainLoopThread

running

protected boolean running

runnables

protected final Array<java.lang.Runnable> runnables

executedRunnables

protected final Array<java.lang.Runnable> executedRunnables

lifecycleListeners

protected final Array<LifecycleListener> lifecycleListeners

logLevel

protected int logLevel
Constructor Detail

LwjglApplication

public LwjglApplication(ApplicationListener listener,
                        java.lang.String title,
                        int width,
                        int height,
                        boolean useGL2)

LwjglApplication

public LwjglApplication(ApplicationListener listener)

LwjglApplication

public LwjglApplication(ApplicationListener listener,
                        LwjglApplicationConfiguration config)

LwjglApplication

public LwjglApplication(ApplicationListener listener,
                        boolean useGL2,
                        java.awt.Canvas canvas)

LwjglApplication

public LwjglApplication(ApplicationListener listener,
                        LwjglApplicationConfiguration config,
                        java.awt.Canvas canvas)

LwjglApplication

public LwjglApplication(ApplicationListener listener,
                        LwjglApplicationConfiguration config,
                        LwjglGraphics graphics)
Method Detail

getAudio

public Audio getAudio()
Specified by:
getAudio in interface Application
Returns:
the Audio instance

getFiles

public Files getFiles()
Specified by:
getFiles in interface Application
Returns:
the Files instance

getGraphics

public LwjglGraphics getGraphics()
Specified by:
getGraphics in interface Application
Returns:
the Graphics instance

getInput

public Input getInput()
Specified by:
getInput in interface Application
Returns:
the Input instance

getNet

public Net getNet()
Specified by:
getNet in interface Application
Returns:
the Net instance

getType

public Application.ApplicationType getType()
Specified by:
getType in interface Application
Returns:
what Application.ApplicationType this application has, e.g. Android or Desktop

getVersion

public int getVersion()
Specified by:
getVersion in interface Application
Returns:
the Android API level on Android or 0 on the desktop.

stop

public void stop()

getJavaHeap

public long getJavaHeap()
Specified by:
getJavaHeap in interface Application
Returns:
the Java heap memory use in bytes

getNativeHeap

public long getNativeHeap()
Specified by:
getNativeHeap in interface Application
Returns:
the Native heap memory use in bytes

getPreferences

public Preferences getPreferences(java.lang.String name)
Description copied from interface: Application
Returns the Preferences instance of this Application. It can be used to store application settings across runs.

Specified by:
getPreferences in interface Application
Parameters:
name - the name of the preferences, must be useable as a file name.
Returns:
the preferences.

getClipboard

public Clipboard getClipboard()
Specified by:
getClipboard in interface Application

postRunnable

public void postRunnable(java.lang.Runnable runnable)
Description copied from interface: Application
Posts a Runnable on the main loop thread.

Specified by:
postRunnable in interface Application
Parameters:
runnable - the runnable.

debug

public void debug(java.lang.String tag,
                  java.lang.String message)
Description copied from interface: Application
Logs a debug message to the console or logcat

Specified by:
debug in interface Application

debug

public void debug(java.lang.String tag,
                  java.lang.String message,
                  java.lang.Throwable exception)
Description copied from interface: Application
Logs a debug message to the console or logcat

Specified by:
debug in interface Application

log

public void log(java.lang.String tag,
                java.lang.String message)
Description copied from interface: Application
Logs a message to the console or logcat

Specified by:
log in interface Application

log

public void log(java.lang.String tag,
                java.lang.String message,
                java.lang.Exception exception)
Description copied from interface: Application
Logs a message to the console or logcat

Specified by:
log in interface Application

error

public void error(java.lang.String tag,
                  java.lang.String message)
Description copied from interface: Application
Logs an error message to the console or logcat

Specified by:
error in interface Application

error

public void error(java.lang.String tag,
                  java.lang.String message,
                  java.lang.Throwable exception)
Description copied from interface: Application
Logs an error message to the console or logcat

Specified by:
error in interface Application

setLogLevel

public void setLogLevel(int logLevel)
Description copied from interface: Application
Sets the log level. Application.LOG_NONE will mute all log output. Application.LOG_ERROR will only let error messages through. Application.LOG_INFO will let all non-debug messages through, and Application.LOG_DEBUG will let all messages through.

Specified by:
setLogLevel in interface Application
Parameters:
logLevel - Application.LOG_NONE, Application.LOG_ERROR, Application.LOG_INFO, Application.LOG_DEBUG.

exit

public void exit()
Description copied from interface: Application
Exits 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.

Specified by:
exit in interface Application

addLifecycleListener

public void addLifecycleListener(LifecycleListener listener)
Description copied from interface: Application
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.

Specified by:
addLifecycleListener in interface Application

removeLifecycleListener

public void removeLifecycleListener(LifecycleListener listener)
Description copied from interface: Application
Removes the LifecycleListener.

Specified by:
removeLifecycleListener in interface Application

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)