Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

It looks that you have to use ScalableGame as a wapper for your AppGameContainer if you want to have an scalable window etc. at least thats what I found in the API.

You then can use the recalculateScale() method to update the scale of your game. I suppose you have to set the new DisplayMode before (like you try to do it now).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.