I'm trying to make a 2D Tile RPG game with LWJGL but I'm having a problem with the display resizing. I want the user to be able to re-size the window to whatever size they want just by expanding it (as opposed to letting them pick a resolution option from a list).
See the images below for the problem.
At default resolution:
At a re-sized resolution:
As you can see the tile is drawn correctly in the first image. However, after moving the camera and resizing the display the tile gets cut off as it moves away from the bottom-left corner of the screen.
The default screen-resolution is 800x600. I have a camera object that moves based on the player using the WASD keys. I decide what's to be drawn by using glTransaltef(camera.x,camera.y,0). Should I use if(Display.wasResized()) in the game loop then get what the new resolution is and use it in the glTranslatef function somehow? Any help or suggestions would be great!
EDIT: I added the code in Fletcher D's answer however it produced this:
The tile doesn't get cut off anymore but in the image above the tile is being drawn at a size of 1x1 pixels. Also when the screen resolution changes the resolution of everything on screen changes, this is not what I want. I want the screen to simply display more of the world. As I said I'm using a panning camera that moves with the player's WASD keys. So if the world is currently being displayed at 0,0 to 800,600 and the player re-sizes the window to 1080x720 I want the display to show the world from -140,-60 to 940,660. (Maintaining the center of the screen at the moment of being re-sized.