Interface Application
- All Known Implementing Classes:
- LegacyApplication,- SimpleApplication,- VRApplication
Application interface represents the minimum exposed
 capabilities of a concrete jME3 application.- 
Method SummaryModifier and TypeMethodDescriptionvoidEnqueues a runnable object to execute in the jME3 rendering thread.<V> Future<V>Enqueues a task/callable object to execute in the jME3 rendering thread.Returns the current AppProfiler hook, or null if none is set.Determine the application's behavior when unfocused.getTimer()booleanReturns true if pause on lost focus is enabled, false otherwise.voidrestart()Restarts the context, applying any changed settings.voidsetAppProfiler(AppProfiler prof) Sets an AppProfiler hook that will be called back for specific steps within a single update frame.voidsetLostFocusBehavior(LostFocusBehavior lostFocusBehavior) Changes the application's behavior when unfocused.voidsetPauseOnLostFocus(boolean pauseOnLostFocus) Enables or disables pause on lost focus.voidsetSettings(AppSettings settings) Set the display settings to define the display created.voidSets the Timer implementation that will be used for calculating frame times.voidstart()Starts the application.voidstart(boolean waitFor) Starts the application.voidstop()Requests the context to close, shutting down the main loop and making necessary cleanup operations.voidstop(boolean waitFor) Requests the context to close, shutting down the main loop and making necessary cleanup operations.
- 
Method Details- 
getLostFocusBehaviorLostFocusBehavior getLostFocusBehavior()Determine the application's behavior when unfocused.- Returns:
- The lost focus behavior of the application.
 
- 
setLostFocusBehaviorChanges the application's behavior when unfocused. By default, the application willthrottle the update loopso as not to use 100% of the CPU when it is out of focus, e.g. alt-tabbed, minimized, or obstructed by another window.- Parameters:
- lostFocusBehavior- The new lost focus behavior to use.
- See Also:
 
- 
isPauseOnLostFocusboolean isPauseOnLostFocus()Returns true if pause on lost focus is enabled, false otherwise.- Returns:
- true if pause on lost focus is enabled
- See Also:
 
- 
setPauseOnLostFocusvoid setPauseOnLostFocus(boolean pauseOnLostFocus) Enables or disables pause on lost focus.By default, pause on lost focus is enabled. If enabled, the application will stop updating when it loses focus or becomes inactive (e.g. alt-tab). For online or real-time applications, this might not be preferable, so this feature should be disabled. For other applications, it is best to keep it enabled so that CPU is not used unnecessarily. - Parameters:
- pauseOnLostFocus- True to enable pause on lost focus, false otherwise.
- See Also:
 
- 
setSettingsSet the display settings to define the display created.Examples of display parameters include display pixel width and height, color bit depth, z-buffer bits, anti-aliasing samples, and update frequency. If this method is called while the application is already running, then restart()must be called to apply the settings to the display.- Parameters:
- settings- The settings to set.
 
- 
setTimerSets the Timer implementation that will be used for calculating frame times. By default, Application will use the Timer as returned by the current JmeContext implementation.- Parameters:
- timer- the desired timer (alias created)
 
- 
getTimerTimer getTimer()
- 
getAssetManagerAssetManager getAssetManager()- Returns:
- The asset managerfor this application.
 
- 
getInputManagerInputManager getInputManager()- Returns:
- the input manager.
 
- 
getStateManagerAppStateManager getStateManager()- Returns:
- the app state manager
 
- 
getRenderManagerRenderManager getRenderManager()- Returns:
- the render manager
 
- 
getRendererRenderer getRenderer()- Returns:
- The rendererfor the application
 
- 
getAudioRendererAudioRenderer getAudioRenderer()- Returns:
- The audio rendererfor the application
 
- 
getListenerListener getListener()- Returns:
- The listenerobject for audio
 
- 
getContextJmeContext getContext()- Returns:
- The display contextfor the application
 
- 
getCameraCamera getCamera()- Returns:
- The main camerafor the application
 
- 
startvoid start()Starts the application. A bug occurring when using LWJGL3 prevents this method from returning until after the application is stopped on macOS.
- 
startvoid start(boolean waitFor) Starts the application. A bug occurring when using LWJGL3 prevents this method from returning until after the application is stopped on macOS.- Parameters:
- waitFor- true→wait for the context to be initialized, false→don't wait
 
- 
setAppProfilerSets an AppProfiler hook that will be called back for specific steps within a single update frame. Value defaults to null.- Parameters:
- prof- the profiler to use (alias created) or null for none (default=null)
 
- 
getAppProfilerAppProfiler getAppProfiler()Returns the current AppProfiler hook, or null if none is set.- Returns:
- the pre-existing instance, or null if none
 
- 
restartvoid restart()Restarts the context, applying any changed settings.Changes to the AppSettingsof this Application are not applied immediately; calling this method forces the context to restart, applying the new settings.
- 
stopvoid stop()Requests the context to close, shutting down the main loop and making necessary cleanup operations. Same as calling stop(false)- See Also:
 
- 
stopvoid stop(boolean waitFor) Requests the context to close, shutting down the main loop and making necessary cleanup operations. After the application has stopped, it cannot be used anymore.- Parameters:
- waitFor- true→wait for the context to be fully destroyed, false→don't wait
 
- 
enqueueEnqueues a task/callable object to execute in the jME3 rendering thread.Callables are executed right at the beginning of the main loop. They are executed even if the application is currently paused or out of focus. - Type Parameters:
- V- type of result returned by the Callable
- Parameters:
- callable- The callable to run in the main jME3 thread
- Returns:
- a new instance
 
- 
enqueueEnqueues a runnable object to execute in the jME3 rendering thread.Runnables are executed right at the beginning of the main loop. They are executed even if the application is currently paused or out of focus. - Parameters:
- runnable- The runnable to run in the main jME3 thread
 
- 
getGuiViewPortViewPort getGuiViewPort()- Returns:
- The GUI viewport. Which is used for the on screen statistics and FPS.
 
- 
getViewPortViewPort getViewPort()
 
-