Class Application

  • All Implemented Interfaces:
    Renderable, Updatable

    public class Application
    extends java.lang.Object
    implements Updatable, Renderable
    Implements a mechanism on top of the renderer that divides the application life cycle into a number of separate scenes. One scene is marked as currently active, and will receive frame updates and render graphics for as a long as it is active. Scenes will also receive notifications whenever the active scene changes.
    • Constructor Detail

      • Application

        public Application​(Renderer renderer)
    • Method Detail

      • changeScene

        public void changeScene​(Scene requestedScene)
        Requests to change the active scene after the current frame has been completed.
        Throws:
        java.lang.IllegalStateException - if a different scene has already been requested, but that scene has not yet started.
      • getActiveScene

        public Scene getActiveScene()
      • lockScreenOrientation

        public void lockScreenOrientation()
        Restricts the application to landscape orientation. When attempting to use the application in portrait application, the current scene will be suspended and an image will be shown prompting to switch back to landscape orientation.
      • update

        public void update​(float deltaTime)
        Description copied from interface: Updatable
        Updates this object for the current frame.
        Specified by:
        update in interface Updatable
        Parameters:
        deltaTime - Elapsed time since the last frame, in seconds.
      • getRenderer

        public Renderer getRenderer()
        Returns the renderer that is used by this application.
      • getCanvas

        public Canvas getCanvas()
      • getApplicationData

        public ApplicationData getApplicationData​(java.lang.String appName)
      • getAverageFPS

        public float getAverageFPS()
      • getAverageFrameTime

        public float getAverageFrameTime()