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
 
Fields inherited from interface com.badlogic.gdx.Application
LOG_ERROR, LOG_INFO, LOG_NONE
 
Constructor Summary
LwjglApplication(ApplicationListener listener, boolean useGL2, java.awt.Canvas canvas)
           
LwjglApplication(ApplicationListener listener, LwjglApplicationConfiguration config)
           
LwjglApplication(ApplicationListener listener, java.lang.String title, int width, int height, boolean useGL2)
           
 
Method Summary
 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.Exception exception)
          Logs an error message to the console or logcat
 void exit()
          Exits the application.
 Audio getAudio()
           
 Files getFiles()
           
 LwjglGraphics getGraphics()
           
 Input getInput()
           
 long getJavaHeap()
           
 long getNativeHeap()
           
 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 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
 

Constructor Detail

LwjglApplication

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

LwjglApplication

public LwjglApplication(ApplicationListener listener,
                        LwjglApplicationConfiguration config)

LwjglApplication

public LwjglApplication(ApplicationListener listener,
                        boolean useGL2,
                        java.awt.Canvas canvas)
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

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.

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.

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.Exception 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 messages issued with Application.error(String, String) through. Application.LOG_INFO will let all messages though, either logged via Application.error(String, String) or Application.log(String, String).

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

exit

public void exit()
Description copied from interface: Application
Exits the application. This will cause a call to pause() and dispose() some time in the loadFuture, it will not immediately finish your application!

Specified by:
exit in interface Application

libgdx API

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