|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.backends.jogl.JoglApplication
public final class JoglApplication
An implemenation of the Application
interface based on Jogl for Windows, Linux and Mac. Instantiate this class with
apropriate parameters and then register ApplicationListener
or InputProcessor
instances.
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 | |
---|---|
JoglApplication(ApplicationListener listener,
JoglApplicationConfiguration config)
|
|
JoglApplication(ApplicationListener listener,
java.lang.String title,
int width,
int height,
boolean useGL20IfAvailable)
Creates a new JoglApplication with the given title and dimensions. |
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()
|
GLCanvas |
getGLCanvas()
|
Graphics |
getGraphics()
|
Input |
getInput()
|
long |
getJavaHeap()
|
javax.swing.JFrame |
getJFrame()
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JoglApplication(ApplicationListener listener, java.lang.String title, int width, int height, boolean useGL20IfAvailable)
JoglApplication
with the given title and dimensions. If useGL20IfAvailable is set the JoglApplication
will try to create an OpenGL 2.0 context which can then be used via JoglApplication.getGraphics().getGL20(). To query
whether enabling OpenGL 2.0 was successful use the JoglApplication.getGraphics().isGL20Available() method.
listener
- the ApplicationListener implementing the program logictitle
- the title of the applicationwidth
- the width of the surface in pixelsheight
- the height of the surface in pixelsuseGL20IfAvailable
- wheter to use OpenGL 2.0 if it is available or notpublic JoglApplication(ApplicationListener listener, JoglApplicationConfiguration config)
Method Detail |
---|
public Audio getAudio()
getAudio
in interface Application
Audio
instancepublic Files getFiles()
getFiles
in interface Application
Files
instancepublic Graphics getGraphics()
getGraphics
in interface Application
Graphics
instancepublic Input getInput()
getInput
in interface Application
Input
instancepublic Application.ApplicationType getType()
getType
in interface Application
Application.ApplicationType
this application has, e.g. Android or Desktoppublic int getVersion()
getVersion
in interface Application
public long getJavaHeap()
getJavaHeap
in interface Application
public long getNativeHeap()
getNativeHeap
in interface Application
public javax.swing.JFrame getJFrame()
public GLCanvas getGLCanvas()
public Preferences getPreferences(java.lang.String name)
Application
Preferences
instance of this Application. It can be used to store application settings across runs.
getPreferences
in interface Application
name
- the name of the preferences, must be useable as a file name.
public void postRunnable(java.lang.Runnable runnable)
Application
Runnable
on the main loop thread.
postRunnable
in interface Application
runnable
- the runnable.public void log(java.lang.String tag, java.lang.String message)
Application
log
in interface Application
public void log(java.lang.String tag, java.lang.String message, java.lang.Exception exception)
Application
log
in interface Application
public void error(java.lang.String tag, java.lang.String message)
Application
error
in interface Application
public void error(java.lang.String tag, java.lang.String message, java.lang.Exception exception)
Application
error
in interface Application
public void setLogLevel(int logLevel)
Application
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)
.
setLogLevel
in interface Application
logLevel
- Application.LOG_NONE
, Application.LOG_ERROR
, Application.LOG_INFO
.public void exit()
Application
exit
in interface Application
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |