Class HeadlessApplication

java.lang.Object
arc.backend.headless.HeadlessApplication
All Implemented Interfaces:
Application, Disposable

public class HeadlessApplication extends Object implements Application
a headless implementation of an application primarily intended to be used in servers
  • Field Details

    • listeners

      protected final Seq<ApplicationListener> listeners
    • runnables

      protected final TaskQueue runnables
    • exceptionHandler

      protected final Cons<Throwable> exceptionHandler
    • renderInterval

      protected long renderInterval
    • mainLoopThread

      protected Thread mainLoopThread
    • running

      protected boolean running
  • Constructor Details

  • Method Details

    • initialize

      protected void initialize()
    • updateTime

      public void updateTime()
    • incrementFrameId

      public void incrementFrameId()
    • getFrameId

      public long getFrameId()
      Description copied from interface: Application
      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 the ApplicationListener.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.
      Specified by:
      getFrameId in interface Application
      Returns:
      the id of the current frame
    • getDeltaTime

      public float getDeltaTime()
      Specified by:
      getDeltaTime in interface Application
      Returns:
      the time span between the current frame and the last frame in seconds. Might be smoothed over n frames.
    • getFramesPerSecond

      public int getFramesPerSecond()
      Specified by:
      getFramesPerSecond in interface Application
      Returns:
      the average number of frames per second
    • getMainThread

      public Thread getMainThread()
      Specified by:
      getMainThread in interface Application
      Returns:
      the main graphics thread, upon which all ApplicationListener methods are called. May return null if not initialized.
    • getType

      public Application.ApplicationType getType()
      Specified by:
      getType in interface Application
      Returns:
      what Application.ApplicationType this application has, e.g. Android or Desktop
    • getClipboardText

      public String getClipboardText()
      Specified by:
      getClipboardText in interface Application
    • setClipboardText

      public void setClipboardText(String text)
      Specified by:
      setClipboardText in interface Application
    • getListeners

      public Seq<ApplicationListener> getListeners()
      Description copied from interface: Application
      Returns a list of all the application listeners used.
      Specified by:
      getListeners in interface Application
    • post

      public void post(Runnable runnable)
      Description copied from interface: Application
      Posts a runnable on the main loop thread.
      Specified by:
      post in interface Application
    • exit

      public void exit()
      Description copied from interface: Application
      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. On iOS this should be avoided in production as it breaks Apples guidelines.
      Specified by:
      exit in interface Application