Quote from: AGP on March 23, 2012, 02:46:18 AM
Usually I make my programs read a configuration file which either specifies a resolution (which the user can change) or has something like fullscreen=true and getCurrentResolution in place of the numerical values, which initializes the app in fullscreen and with the current resolution. If you notice, most games tell you after you change their resolution that in order to see the change you'll have to restart the game. So just do that.
In pure LWJGL, I can easily do this, and since jPCT is based on LWJGL, I thought it should be possible here. I have the following code in my game loop:
Code Select
if (Display.wasResized()) {
GL11.glViewport(0, 0, Display.getWidth(), Display.getHeight());
scene.resize();
gui.resize();
}
Where scene is a custom object I've created that holds all my game objects, and gui is a TWL GUI Widget that contains all my 2D game controls. Why wouldn't this port over to jPCT well?