public abstract class AcceleratedDisplay
extends java.lang.Object
FunGraphics
Modifier and Type | Field and Description |
---|---|
protected java.awt.image.BufferedImage |
backBuffer |
protected java.awt.Graphics2D |
backg2d |
protected java.awt.image.BufferStrategy |
bufferStrategy
Buffer and g2d stuff
|
protected boolean |
checkBorders |
protected float |
current_fps |
protected boolean |
DISPLAY_FPS |
protected boolean |
enableRenderingHints |
protected int |
fHeight |
java.awt.image.BufferedImage |
frontBuffer |
protected java.awt.Graphics2D |
frontg2d |
protected int |
fWidth |
protected java.awt.Graphics2D |
g2d |
private GraphicTimer |
gt
Used for game loop synchronization
|
protected javax.swing.JFrame |
mainFrame
The subclass which create the windows frame
|
protected static int |
numBuffers |
protected int |
target_fps |
protected java.awt.Color |
TRANSPARENT |
protected static boolean |
VERBOSE |
Constructor and Description |
---|
AcceleratedDisplay(int width,
int height,
int xPos,
int yPos,
java.lang.String title,
boolean high_quality) |
AcceleratedDisplay(int width,
int height,
java.lang.String title,
boolean high_quality) |
Modifier and Type | Method and Description |
---|---|
void |
displayFPS(boolean x) |
private void |
initFrame(java.lang.String title,
int width,
int height,
int xOffset,
int yOffset) |
private void |
internalRender()
This rendering method is called by the rendering thread, always
|
void |
syncGameLogic(int FPS)
Call this method periodically to have a constant frame rate
|
protected javax.swing.JFrame mainFrame
protected int fWidth
protected int fHeight
protected static final boolean VERBOSE
protected boolean DISPLAY_FPS
protected java.awt.image.BufferStrategy bufferStrategy
protected static final int numBuffers
protected boolean enableRenderingHints
protected boolean checkBorders
protected java.awt.Graphics2D g2d
protected java.awt.Graphics2D frontg2d
protected java.awt.Graphics2D backg2d
public java.awt.image.BufferedImage frontBuffer
protected java.awt.image.BufferedImage backBuffer
protected java.awt.Color TRANSPARENT
protected int target_fps
protected float current_fps
private GraphicTimer gt
public AcceleratedDisplay(int width, int height, java.lang.String title, boolean high_quality)
public AcceleratedDisplay(int width, int height, int xPos, int yPos, java.lang.String title, boolean high_quality)
width
- height
- xPos
- x offset position of the window on the screen, -1 for centeredyPos
- y offset position of the window on the screen, -1 for centeredtitle
- high_quality
- public void displayFPS(boolean x)
x
- Selects if the FPS should be printed or notprivate void initFrame(java.lang.String title, int width, int height, int xOffset, int yOffset)
title
- width
- height
- xOffset
- The x offset of the window on the screen, -1 if centeredyOffset
- The y offset of the window on the screen, -1 if centeredprivate void internalRender()
public void syncGameLogic(int FPS)
FPS
-