Class GDXRenderer

java.lang.Object
nl.colorize.multimedialib.renderer.libgdx.GDXRenderer
All Implemented Interfaces:
com.badlogic.gdx.ApplicationListener, Renderer, SceneContext

public class GDXRenderer extends Object implements Renderer, SceneContext, com.badlogic.gdx.ApplicationListener
Renderer built on top of the libGDX framework. In turn, libGDX supports multiple back-end implementations that determine which platforms are supported and which libraries are used.
  • Constructor Details

    • GDXRenderer

      public GDXRenderer()
  • Method Details

    • start

      public void start(RenderConfig config, Scene initialScene)
      Description copied from interface: Renderer
      Starts this renderer based on the specified configuration. The renderer will initially display the specified scene.

      This method can be called from any thread. The renderer will run in its own thread, which is started by calling this method. All callback methods will be called from the renderer thread.

      Specified by:
      start in interface Renderer
    • create

      public void create()
      Specified by:
      create in interface com.badlogic.gdx.ApplicationListener
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.ApplicationListener
    • resize

      public void resize(int width, int height)
      Specified by:
      resize in interface com.badlogic.gdx.ApplicationListener
    • pause

      public void pause()
      Specified by:
      pause in interface com.badlogic.gdx.ApplicationListener
    • resume

      public void resume()
      Specified by:
      resume in interface com.badlogic.gdx.ApplicationListener
    • render

      public void render()
      Specified by:
      render in interface com.badlogic.gdx.ApplicationListener
    • terminate

      public void terminate()
      Description copied from interface: SceneContext
      Terminates the renderer, which will end the animation loop and quit the application.
      Specified by:
      terminate in interface SceneContext
    • createMesh

      public Mesh createMesh(Shape3D shape, ColorRGB color)
      Description copied from interface: SceneContext
      Programmatically creates a 3D polygon mesh with a solid color, based on the specified shape.
      Specified by:
      createMesh in interface SceneContext
    • project

      public Point2D project(Point3D position)
      Description copied from interface: SceneContext
      Returns the 3D world coordinates that correspond to the specified 2D canvas coordinates, based on the current camera position.
      Specified by:
      project in interface SceneContext
    • castPickRay

      public boolean castPickRay(Point2D canvasPosition, Box area)
      Description copied from interface: SceneContext
      Casts a pick ray from the specified 2D canvas position, and returns true if the pick ray intersects with the specified 3D world coordinates.
      Specified by:
      castPickRay in interface SceneContext
    • takeScreenshot

      public void takeScreenshot(File screenshotFile)
      Description copied from interface: SceneContext
      Captures a screenshot of the renderer's current graphics and then exports the screenshot to a PNG file.
      Specified by:
      takeScreenshot in interface SceneContext
    • isSupported

      public boolean isSupported(GraphicsMode graphicsMode)
      Specified by:
      isSupported in interface Renderer
    • getRendererName

      public String getRendererName()
      Description copied from interface: SceneContext
      Returns the display name for the underlying renderer. The display name will not include the word "renderer".
      Specified by:
      getRendererName in interface SceneContext
    • getConfig

      public RenderConfig getConfig()
      Specified by:
      getConfig in interface SceneContext
    • getInput

      public GDXInput getInput()
      Specified by:
      getInput in interface SceneContext
    • getMediaLoader

      public GDXMediaLoader getMediaLoader()
      Specified by:
      getMediaLoader in interface SceneContext
    • getNetwork

      public Network getNetwork()
      Specified by:
      getNetwork in interface SceneContext
    • getSceneManager

      public SceneManager getSceneManager()
      Specified by:
      getSceneManager in interface SceneContext
    • getStage

      public Stage getStage()
      Specified by:
      getStage in interface SceneContext