Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个使用LWJGL的游戏,我需要一种方法来最小化 Display 的方法。有没有办法做到这一点?
最简单的方法是将 LWJGL 嵌入到 JPanel、Canvas 或类似的东西中。这样做可以让您完全控制 OpenGL 层调整大小的方式等。如果您想开始使用它,您甚至可以拥有自己的小“OpenGL 控件”。这里和这里有两个很好的例子。它的重要部分非常简单:
Display.setParent(myAwtOrSwingControl);
在此之后,您可以设置:
myFrame.setState ( Frame.ICONIFIED );
实现您正在寻找的最小化。