Hi all,
I am having a little trouble getting FSEM to work the way I think it should work. (My expectations might be to blame, but I don’t think so.)
The game client allows the user to toggle back and forth between FSEM and windowed modes. But when I exit the JVM using System.exit(0), the screen does that funny thing that it does when it switches into one mode or the other (I don’t know exactly what’s going on underneath the hood, but you know–screen goes black, things flash around a bit, then the mode is switched). That would be fine except that this happens even if the app is already in windowed mode when I exit the game. If the game is already in windowed mode, shouldn’t it just exit as if I’d never entered FSEM in the first place?
(I’ve checked the logic, and there is no duplicate call to GraphicsDevice.setFullScreenWindow()… so that’s not it.)
I tried Thread.sleep()-ing for five seconds before the exit, thinking that maybe the System.exit(0) was abruptly preventing some other thread from completing. That did not make a difference. After the five seconds, the System.exit(0) got called, and then the screen turned black, flashed, and went into windowed mode on exit (even though it was already in windowed mode).
Thanks,
Willie