Class Java2DRenderer
java.lang.Object
nl.colorize.multimedialib.renderer.java2d.Java2DRenderer
- All Implemented Interfaces:
Renderer
Implementation of a renderer that uses APIs from the Java standard library.
Graphics are displayed using Java 2D, AWT is used to create windows and capture
keyboard events, and Java Sound is used to play audio.
The renderer will use two different threads: the rendering thread is used to update the graphics, while the Swing thread is used to listen for user input.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
start
(Scene initialScene, ErrorHandler errorHandler) Initializes this renderer and starts playing the requested scene.void
Ends the animation loop, stops this renderer, and quits the application.toString()
-
Constructor Details
-
Java2DRenderer
-
-
Method Details
-
start
Description copied from interface:Renderer
Initializes this renderer and starts playing the requested scene. Errors that occur during the application will be forwarded to the specified error handler.As explained in the class documentation, this is the only method in
Renderer
that can be safely called from outside the renderer's application loop. -
getGraphicsMode
- Specified by:
getGraphicsMode
in interfaceRenderer
-
getDisplayMode
- Specified by:
getDisplayMode
in interfaceRenderer
-
terminate
public void terminate()Description copied from interface:Renderer
Ends the animation loop, stops this renderer, and quits the application.Renderer
instances cannot be reused, restarting a previously terminated renderer is not possible. -
toString
-