automatically switch to fullscreen

This commit is contained in:
2025-12-08 06:18:03 +01:00
parent afcc32dc9f
commit b4d07b0d99
2 changed files with 13 additions and 1 deletions

View File

@@ -222,6 +222,16 @@ public class GamePanel extends JPanel implements Runnable {
tempScreen = new BufferedImage(screenWidth, screenHeight, BufferedImage.TYPE_INT_RGB);
fg2 = (Graphics2D) tempScreen.getGraphics();
setFullscreen();
}
public void setFullscreen() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getDefaultScreenDevice();
gd.setFullScreenWindow(Boot.window);
fScreenWidth = Boot.window.getWidth();
fScreenHeight = Boot.window.getHeight();
}
}