Changing DisplayMode seems not to update Input&Graphic Dimension

Posted by coding.mof on Game Development See other posts from Game Development or by coding.mof
Published on 2012-04-30T11:18:51Z Indexed on 2012/08/27 21:58 UTC
Read the original article Hit count: 290

Filed under:
|

I'm writing a small game using Slick and Nifty-GUI.
At the program startup I set the DisplayMode using the following lines:

AppGameContainer app = new ...
app.setDisplayMode( 800, 600, false );
app.start();

I wrote a Nifty-ScreenController for my settings dialog in which the user can select the desired DisplayMode. When I try to set the new DisplayMode within this controller class the game window gets resized correctly but the Graphics and Input objects aren't updated accordingly. Therefore my rendering code just uses a part of the new window.

I tried to set different DisplayModes in the main method to test if it's generally possible to invoke this method multiple times. It seems that changing the DisplayMode only works before I call app.start().

Furthermore I tried to update the Graphics & Input object manually but the init and setDimensions methods are package private. :(

Does someone know what I'm doing wrong and how to change the DisplayMode correctly?

© Game Development or respective owner

Related posts about java

Related posts about slick