Add a config switch for antialiasing rendering hints.
This commit is contained in:
parent
fc66c15cd6
commit
35301b0d27
|
@ -159,9 +159,11 @@ public class GameFrame extends JFrame {
|
|||
* KEY_ANTIALIASING is very expensive and doesn't do much more over KEY_TEXT_ANTIALIASING
|
||||
*/
|
||||
private void applyRenderingHints(Graphics2D bufferedGraphics) {
|
||||
//bufferedGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
if(GameConfig.antialiasing == true) {
|
||||
bufferedGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
bufferedGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the time in nanoseconds the last draw() call took.
|
||||
|
|
|
@ -25,6 +25,11 @@ public class GameConfig {
|
|||
*/
|
||||
public static String windowTitle = "SpaceScooter!";
|
||||
|
||||
/**
|
||||
* Whether or not anti aliasing rendering hints will be used.
|
||||
*/
|
||||
public static boolean antialiasing = false;
|
||||
|
||||
|
||||
/**
|
||||
* Private constructor, this class will never be instantiated.
|
||||
|
|
Loading…
Reference in New Issue