Windows Phone Fullscreen

Monkey Targets Forums/XNA/Windows Phone Fullscreen

Amnesia(Posted 2012) [#1]
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.


Xaron(Posted 2012) [#2]
Hmm... I just set it to 480x800 as this is the only viable device resolution at the moment.


Amnesia(Posted 2012) [#3]
Yes, but the status bar still appears (at least on our LG C900 test phone). Setting the IsFullScreen flag gets rid of it.


Aman(Posted 2012) [#4]
I don't see the status bar on the emulator when I run my games.


Amnesia(Posted 2012) [#5]
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.


Xaron(Posted 2012) [#6]
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


dopeyrulz(Posted 2012) [#7]
Xaron,

It's full screen on my phone.


Amnesia(Posted 2012) [#8]
Xaron, it's fullscreen here as well. Nice game by the way.


Xaron(Posted 2012) [#9]
Thank you! Ok that's nice to know, because I had not to use the way you do it with the code above...


Amnesia(Posted 2012) [#10]
What version of Monkey was used to compile your game?


Xaron(Posted 2012) [#11]
I think it was V49.


Amnesia(Posted 2012) [#12]
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.


Xaron(Posted 2012) [#13]
Ah thanks for letting me know! :)