Is Rotation currently working? I.e. How do I know if I'm Portrait?

Using MonoGameSample from Mishu linked off this topic:

and built it. I’m running it on VS 2013 Community, and running in Emulator 8.1 WVGA 4 inch 512MB.
Despite the phone being in Portrait, the sample comes up in Landscape. Digging in to the graphics class in the draw loop I find:

GraphicsDevice->Adapator->CurrentDisplayMode says 800x600, which is clearly wrong.
Viewport says 800x480, which is the right dimensions for Landscape.
PresentationParameters says BackBuffer is 800x480 and DisplayOrientation is Portrait. For Portrait I’d expect it to say 480x800. The display output of the sample (the beehive and framerate text) is also displaying landscape, so sideways.

This sample has an object in App.xaml, which is the same thing I get when I do a Empty Windows Phone Blank Page template in VS. So I’m not sure about where to put the SupportedDisplayMode info that goes into the objects in other templates.

Next I tried following the directions in the readme of the nuget Monogames 3.2.3-alpha package. I did an empty C# Windows Phone Blank Page template, then installed the Monogames package. This gave me an app with a rotating cube sample object in my draw loop. It’s using direct3D and drawing a spinning cube rotating about the Y axis. But in this case too when I look at all the values in graphics I get BackBuffer and Viewport both reporting Landscape values.
My spritebatch.DrawString, however, which I put after all the 3D drawing, displays correctly across that top of the screen. So that’s an improvement, I am getting portrait display. But what values am I supposed to believe?

Two days of beating my head on this is long enough, so I’m appealing to the experts. What’s the right thing to do? I just want to make a simple 2D sprite animated mobile game.

Thanks,

Rick Saada

Hi :slight_smile:
I am experiencing the same with Monogame 3.3, while trying to make a Universal App.
It seems that after tilting the phone sideways into Landscape mode and coming back to Portrait, the values are reported correctly.
However it would still be easier if the dimensions (width,height) were reporting correctly :smile:

Kind regards - Jakob

If you’re both refering to WP8.1/Universal, I think this may be related to this fix:

unfortunately there’s no submitted fix available yet.

KakCat - unless I’m mistaken (that would be a first! ;-)) the thread you’re linking to is about slow responses to touch…
How does that relate to height/width of screen being reported wrong?

Kind regards - Jakob

Hi Rick :smile:
This worked for me: WP 8.1 Portrait mode

Kind regards - Jakob

hi,

sorry, I misunderstood the text. Sometimes WP8.1 can delay the initial rotation under high CPU usage. That thread links a PR which fixes the problem, but this is obviously not related to your problem.