|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jme.app.AbstractGame
com.jmex.game.StandardGame
public final class StandardGame
StandardGame intends to be a basic implementation of a game that can be
utilized in games as a logical next step from SimpleGame and can be utilized
in production games.
| Nested Class Summary | |
|---|---|
static class |
StandardGame.GameType
|
| Nested classes/interfaces inherited from class com.jme.app.AbstractGame |
|---|
AbstractGame.ConfigShowMode |
| Field Summary | |
|---|---|
static int |
DISPLAY_CANVAS
|
static int |
DISPLAY_MODE
|
static int |
DISPLAY_WINDOW
|
static boolean |
THREAD_FRIENDLY
|
| Constructor Summary | |
|---|---|
StandardGame(String gameName)
|
|
StandardGame(String gameName,
StandardGame.GameType type)
|
|
StandardGame(String gameName,
StandardGame.GameType type,
GameSettings settings)
|
|
StandardGame(String gameName,
StandardGame.GameType type,
GameSettings settings,
Thread.UncaughtExceptionHandler exceptionHandler)
|
|
| Method Summary | ||
|---|---|---|
void |
delayForUpdate()
Causes the current thread to wait for an update to occur in the OpenGL thread. |
|
|
executeInGL(Callable<T> callable)
Convenience method that will make sure callable is executed in the
OpenGL thread. |
|
Camera |
getCamera()
The internally used Camera for this instance of
StandardGame. |
|
Canvas |
getCanvas()
The java.awt.Canvas if DISPLAY_CANVAS is the DISPLAY_MODE |
|
DisplaySystem |
getDisplay()
The internally used DisplaySystem for this instance
of StandardGame |
|
StandardGame.GameType |
getGameType()
|
|
GameSettings |
getSettings()
The GameSettings implementation being utilized in
this instance of StandardGame. |
|
boolean |
inGLThread()
Convenience method to let you know if the thread you're in is the OpenGL thread |
|
boolean |
isStarted()
Will return true if within the main game loop. |
|
void |
lock()
Will wait for a lock at the beginning of the OpenGL update method. |
|
void |
recreateGraphicalContext()
|
|
void |
reinit()
reinit rebuilds the subsystems. |
|
void |
reinitAudio()
|
|
void |
reinitVideo()
|
|
void |
resetCamera()
|
|
void |
run()
|
|
void |
setBackgroundColor(ColorRGBA backgroundColor)
Override the background color defined for this game. |
|
void |
setIcons(Image[] icons)
|
|
void |
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler)
Specify the UncaughtExceptionHandler for circumstances where an exception in the OpenGL thread is not captured properly. |
|
void |
shutdown()
Gracefully shutdown the main game loop thread. |
|
void |
start()
start begins the game. |
|
void |
unlock()
Used in conjunction with lock() in order to release a previously assigned lock on the OpenGL thread. |
|
| Methods inherited from class com.jme.app.AbstractGame |
|---|
finish, getVersion, setConfigShowMode, setConfigShowMode |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DISPLAY_WINDOW
public static final int DISPLAY_CANVAS
public static boolean THREAD_FRIENDLY
public static int DISPLAY_MODE
| Constructor Detail |
|---|
public StandardGame(String gameName)
public StandardGame(String gameName,
StandardGame.GameType type)
public StandardGame(String gameName,
StandardGame.GameType type,
GameSettings settings)
public StandardGame(String gameName,
StandardGame.GameType type,
GameSettings settings,
Thread.UncaughtExceptionHandler exceptionHandler)
| Method Detail |
|---|
public StandardGame.GameType getGameType()
public void start()
AbstractGamestart begins the game. The game is initialized by calling
first initSystem then initGame. Assuming
no errors were encountered during initialization, the main game loop is
entered. How the loop operates is implementation-dependent. After the
game loop is broken out of via a call to finish,
cleanup is called. Subclasses should declare this method
final.
start in class AbstractGamepublic void run()
run in interface Runnablepublic Canvas getCanvas()
public void resetCamera()
public void reinit()
AbstractGamereinit rebuilds the subsystems. It may be called at any
time by the client application.
public void reinitAudio()
public void reinitVideo()
public void recreateGraphicalContext()
public DisplaySystem getDisplay()
DisplaySystem for this instance
of StandardGame
DisplaySystempublic Camera getCamera()
Camera for this instance of
StandardGame.
Camerapublic GameSettings getSettings()
GameSettings implementation being utilized in
this instance of StandardGame.
GameSettingspublic void setBackgroundColor(ColorRGBA backgroundColor)
backgroundColor - public void shutdown()
AbstractGame.finish()public boolean isStarted()
public void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler)
exceptionHandler -
public void delayForUpdate()
throws InterruptedException,
ExecutionException
InterruptedException
ExecutionExceptionpublic boolean inGLThread()
public <T> T executeInGL(Callable<T> callable)
throws Exception
callable is executed in the
OpenGL thread. If it is already in the OpenGL thread when this method is invoked
it will be executed and returned immediately. Otherwise, it will be put into the
GameTaskQueue and executed in the next update. This is a blocking method and will
wait for the successful return of callable before returning.
T - callable -
Exceptionpublic void lock()
public void unlock()
public void setIcons(Image[] icons)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||