Windows Phone FullscreenMonkey Targets Forums/XNA/Windows Phone Fullscreen
| When compiling a project for Windows Phone I noticed that the game didn't go fullscreen. The XNA_WINDOW_FULLSCREEN didn't seem to effect at all.
After checking the generated code I noticed something was missing ...
#if WINDOWS deviceManager.IsFullScreen=bool.Parse( MonkeyConfig.XNA_WINDOW_FULLSCREEN ); deviceManager.PreferredBackBufferWidth=int.Parse( MonkeyConfig.XNA_WINDOW_WIDTH ); deviceManager.PreferredBackBufferHeight=int.Parse( MonkeyConfig.XNA_WINDOW_HEIGHT ); Window.AllowUserResizing=bool.Parse( MonkeyConfig.XNA_WINDOW_RESIZABLE ); #elif XBOX deviceManager.PreferredBackBufferWidth=int.Parse( MonkeyConfig.XNA_WINDOW_WIDTH_XBOX ); deviceManager.PreferredBackBufferHeight=int.Parse( MonkeyConfig.XNA_WINDOW_HEIGHT_XBOX ); #elif WINDOWS_PHONE deviceManager.PreferredBackBufferWidth=int.Parse( MonkeyConfig.XNA_WINDOW_WIDTH_PHONE ); deviceManager.PreferredBackBufferHeight=int.Parse( MonkeyConfig.XNA_WINDOW_HEIGHT_PHONE ); #endif
Adding the following to the WINDOWS_PHONE #elif block makes the fullscreen flag to also have impact on the Windows Phone build.
deviceManager.IsFullScreen = bool.Parse(MonkeyConfig.XNA_WINDOW_FULLSCREEN);
It would be nice if the code generated by Monkey had this by default. Perhaps a separate flag XNA_WINDOW_FULLSCREEN_PHONE would be a better idea than using the XNA_WINDOW_FULLSCREEN one.
| Hmm... I just set it to 480x800 as this is the only viable device resolution at the moment.
| Yes, but the status bar still appears (at least on our LG C900 test phone). Setting the IsFullScreen flag gets rid of it.
| I don't see the status bar on the emulator when I run my games.
| Perhaps it's only necessary on certain devices (like the one we are using to test, the LG C900), or perhaps the emulator doesn't behave exactly as the real thing, no idea. Thing is, I had to add the flag to get fullscreen on our phone.
| Amnesia, could you please test my game if it's full screen on your device? I'm just curious: http://www.windowsphone.com/en-US/apps/c554fbb4-dded-4e3e-9410-b0663047ac51
It's full screen on my phone.
| Xaron, it's fullscreen here as well. Nice game by the way.
| Thank you! Ok that's nice to know, because I had not to use the way you do it with the code above...
| What version of Monkey was used to compile your game?
| I think it was V49.
| Oh, that explains it. Fullscreen seems to work out-of-the-box in previous versions of Monkey (up to V51). I should have stated that I needed to do this when I updated to V53.
I just checked mojo.xna.cs and since V52(f) gxtkGame's constructor discriminate between Windows Phone and the other XNA targets. The IsFullScreen flag was left out for the Windows Phone target.
Now, I don't know if ALL WP7 devices need the flag there to show a fullscreen window, but at least that's true for the LG C900.
| Ah thanks for letting me know! :)