com.jme3.app.state
Interface AppState

All Known Implementing Classes:
AbstractAppState, BulletAppState, Cinematic, DebugKeysAppState, FlyCamAppState, ResetStatsState, ScreenshotAppState, StatsAppState, VideoRecorderAppState

public interface AppState

AppState represents a continously executing code inside the main loop. An AppState can track when it is attached to the AppStateManager or when it is detached.
AppStates are initialized in the render thread, upon a call to initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application) and are de-initialized upon a call to cleanup(). Implementations should return the correct value with a call to isInitialized() as specified above.


Method Summary
 void cleanup()
          Cleanup the game state.
 void initialize(AppStateManager stateManager, Application app)
          Called to initialize the AppState.
 boolean isEnabled()
           
 boolean isInitialized()
           
 void postRender()
          Called after all rendering commands are flushed.
 void render(RenderManager rm)
          Render the state.
 void setEnabled(boolean active)
          Enable or disable the functionality of the AppState.
 void stateAttached(AppStateManager stateManager)
          Called when the state was attached.
 void stateDetached(AppStateManager stateManager)
          Called when the state was detached.
 void update(float tpf)
          Called to update the state.
 

Method Detail

initialize

void initialize(AppStateManager stateManager,
                Application app)
Called to initialize the AppState.

Parameters:
stateManager - The state manager
app -

isInitialized

boolean isInitialized()
Returns:
True if initialize() was called on the state, false otherwise.

setEnabled

void setEnabled(boolean active)
Enable or disable the functionality of the AppState. The effect of this call depends on implementation. An AppState starts as being enabled by default.

Parameters:
active - activate the AppState or not.

isEnabled

boolean isEnabled()
Returns:
True if the AppState is enabled, false otherwise.
See Also:
setEnabled(boolean)

stateAttached

void stateAttached(AppStateManager stateManager)
Called when the state was attached.

Parameters:
stateManager - State manager to which the state was attached to.

stateDetached

void stateDetached(AppStateManager stateManager)
Called when the state was detached.

Parameters:
stateManager - The state manager from which the state was detached from.

update

void update(float tpf)
Called to update the state.

Parameters:
tpf - Time per frame.

render

void render(RenderManager rm)
Render the state.

Parameters:
rm - RenderManager

postRender

void postRender()
Called after all rendering commands are flushed.


cleanup

void cleanup()
Cleanup the game state.