I’ve got the following problem:
If I change the resolution:
AppSettings settings = new AppSettings(true);
everything is fine. So to notify nifty about the changed resolution, I do this
//indicates that nifty has to refresh all screens
The current screen is reloaded and it looks nice, but all other screens don’t change the resolution.
It would work If I make a hard reset and reload the screens from the xml-file but that doesn’t seem to be a good idea.
So how can I notify nifty to notify all other screens, too?
I think just reloading them completely would be the best solution in your case. If this is supposed to be remedied then that solution will be the easiest to revert (instead of maybe updating all screens). Unless ofc theres a method like updateAllScreens()…
In your screen controller you could always do nifty.resolutionChanged in onStartScreen for all screen controllers.
It sounds like this may be a bug though. @void256, what do you think?
@zarch: that causes some wired flickering. Seems like that nifty try’s to paint and load the screen at the same time.
@normen: That worked so far.
Now I’ve got this one when I switch from fullscreen back to window:
SCHWERWIEGEND: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalStateException: Keyboard must be created before you can poll the device
A workaround would be to restart the app. Not really nice but as I remember there are many games out there that have trouble switching the resolution. So I think this is okay for now.
Okay, this was rubbish. I don’t really know what happened but it wasn’t a keyboard-problem.
Hmm, maybe the resolution changed causes onstartscreen to be called again?
Could always use a flag to avoid that…be better to get a proper fix though.