我想要的是在所有操作系统上最大化的GLWindow。因此,window.setSize(300, 300);
行应替换为window.setSize(GLWindow.MAXIMIZED);
之类的内容。我已经找了很久了,但我找不到应该怎么做。提前谢谢。
主:
public static void main(String[] args) {
GLProfile glp = GLProfile.getDefault();
GLCapabilities caps = new GLCapabilities(glp);
WindowFactory windowFactory = new WindowFactory();
GLWindow window = windowFactory.getWindow(caps);
window.addGLEventListener(new Main());
FPSAnimator animator = new FPSAnimator(window, 30);
animator.start();
}
窗口:
public GLWindow getWindow(GLCapabilities caps) {
GLWindow window = GLWindow.create(caps);
window.setSize(300, 300);
window.setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSE);
window.setVisible(true);
return window;
}
答案 0 :(得分:0)
public GLWindow getWindow(GLCapabilities caps) {
GLWindow window = GLWindow.create(caps);
Screen screen = window.getScreen();
window.setSize(screen.getWidth, screen.getHeight);
window.setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSE);
window.setVisible(true);
return window;
}