Package arc
Interface Application
- All Superinterfaces:
Disposable
- All Known Implementing Classes:
HeadlessApplication,MockApplication
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddListener(ApplicationListener listener) Adds a new application listener.default voidCall this before update() in each backend.default voiddispose()Disposes of core resources.voidexit()Schedule an exit from the application.default floatdefault voiddefault longReturns the id of the current frame.default intdefault longReturns a list of all the application listeners used.default ThreadgetType()default intdefault booleanDeprecated.default booleanDeprecated.default booleanDeprecated.default booleanisIOS()Deprecated.default booleanisMobile()Deprecated.default booleandefault booleanisWeb()voidPosts a runnable on the main loop thread.default voidremoveListener(ApplicationListener listener) Removes an application listener.Methods inherited from interface arc.util.Disposable
isDisposed
-
Method Details
-
getListeners
Seq<ApplicationListener> getListeners()Returns a list of all the application listeners used. -
addListener
Adds a new application listener. -
removeListener
Removes an application listener. -
defaultUpdate
default void defaultUpdate()Call this before update() in each backend. -
getType
Application.ApplicationType getType()- Returns:
- what
Application.ApplicationTypethis application has, e.g. Android or Desktop
-
isDesktop
Deprecated. -
isHeadless
Deprecated. -
isAndroid
Deprecated. -
isIOS
Deprecated. -
isMobile
Deprecated. -
isWeb
default boolean isWeb() -
getVersion
default int getVersion()- Returns:
- the Android API level on Android, the major OS version on iOS (5, 6, 7, ..), or 0 on the desktop.
-
getFrameId
default long getFrameId()Returns the id of the current frame. The general contract of this method is that the id is incremented only when the application is in the running state right before calling theApplicationListener.update()method. Also, the id of the first frame is 0; the id of subsequent frames is guaranteed to take increasing values for 263-1 rendering cycles.- Returns:
- the id of the current frame
-
getDeltaTime
default float getDeltaTime()- Returns:
- the time span between the current frame and the last frame in seconds. Might be smoothed over n frames.
-
getFramesPerSecond
default int getFramesPerSecond()- Returns:
- the average number of frames per second
-
getJavaHeap
default long getJavaHeap()- Returns:
- the Java heap memory use in bytes.
-
getMainThread
- Returns:
- the main graphics thread, upon which all ApplicationListener methods are called. May return null if not initialized.
-
isOnMainThread
default boolean isOnMainThread()- Returns:
- whether the currently executing thread is the main thread. If the main thread is not initialized, returns true by default. This is used for error checking purposes.
-
getDnsServers
-
post
Posts a runnable on the main loop thread. -
exit
void exit()Schedule an exit from the application. On android, this will cause a call to pause() and dispose() some time in the future, it will not immediately finish your application. -
dispose
default void dispose()Disposes of core resources.- Specified by:
disposein interfaceDisposable
-