Public Member Functions | |
Graphics (int windowWidth, int windowHeight) | |
void | draw (World world) |
void | addCameraController (CameraController controller) |
Static Public Member Functions | |
static void | dispose () |
Static Public Attributes | |
static final String | TEXTURE_PATH = "res/textures/" |
static final int | TICKS_PER_SECOND = 60 |
static final long | MILLIS_PER_TICK = 1000 / TICKS_PER_SECOND |
Static Package Functions | |
static Graphics | getInstance () |
static Texture | getTexture (String path) |
The top-level class for the Graphics system.
Definition at line 23 of file Graphics.java.
bubolo.graphics.Graphics.Graphics | ( | int | windowWidth, |
int | windowHeight | ||
) |
Creates the graphics system.
windowWidth | the width of the window, in pixels. |
windowHeight | the height of the window, in pixels. |
Definition at line 112 of file Graphics.java.
void bubolo.graphics.Graphics.addCameraController | ( | CameraController | controller | ) |
Adds the specified camera controller.
controller | a camera controller. The update method will be called once per draw call. |
Definition at line 157 of file Graphics.java.
|
static |
Destroys all textures.
Definition at line 99 of file Graphics.java.
void bubolo.graphics.Graphics.draw | ( | World | world | ) |
Draws the entities that are within the camera's clipping boundary.
world | reference to the World Model object. |
Definition at line 128 of file Graphics.java.
References bubolo.graphics.DrawLayer.OBJECTS, bubolo.graphics.DrawLayer.TANKS, bubolo.graphics.DrawLayer.TERRAIN, and bubolo.graphics.DrawLayer.TERRAIN_MODIFIERS.
|
staticpackage |
Gets a reference to the Graphics system. The Graphics system must be explicitly constructed using the Graphics(width, height)
constructor before this is called, or an IllegalStateException
will be thrown. This method is package-private, because only objects within the Graphics system should have access to it.
IllegalStateException | when the Graphics system has not been explicitly constructed using the Graphics(width, height) constructor. |
Definition at line 65 of file Graphics.java.
|
staticpackage |
Returns a texture from a path. Ensures that the same texture isn't store multiple times. Will load the file if it has not yet been loaded.
path | the path to the texture file. |
FileNotFoundException | if the file is not found on the file system (can only occur if the file has not yet been loaded). |
Definition at line 83 of file Graphics.java.
|
static |
The number of milliseconds per draw tick.
Definition at line 38 of file Graphics.java.
Referenced by bubolo.BuboloApplication.render().
|
static |
File path where textures are stored.
Definition at line 28 of file Graphics.java.
|
static |
The target number of draw ticks per second.
Definition at line 33 of file Graphics.java.