Microsoft KB Archive/843485

= Problems may occur when you use a GAPI application in landscape mode in Windows Mobile 2003 Second Edition software for Pocket PC =

Article ID: 843485

Article Last Modified on 3/22/2005

-

APPLIES TO


 * Microsoft Windows Mobile 2003 software for Pocket PC Standard Edition

-



SYMPTOMS
The following problems may occur in Microsoft Windows Mobile 2003 Second Edition software for Pocket PC when you try to use a Microsoft Windows Mobile-based Game API (GAPI) application in landscape mode:
 * A GAPI application may start in portrait mode when you may expect the application to start in landscape mode.
 * A GAPI application that does not fill the whole screen may cause corruption of the title bar and of the menu bar in landscape mode.



MORE INFORMATION
If an application is built by using the Windows Mobile 2003 SDK or earlier versions, GAPI forces the device into portrait mode when the GXOpenDisplay function is called. This is because earlier applications expect the device to be in portrait mode. There is no direct way to create a new GAPI application that supports landscape mode.

The GXSetViewport API for GAPI does not actually set up a rectangular viewport. The GXSetViewport API sets up a horizontal band that stretches across the screen. This is not a problem for portrait-mode applications. However, in landscape mode, that band intersects parts of the title bar and parts of the menu bar. The GXSetViewport API does not work on all devices in landscape mode. Specifically, the GXSetViewport API does not work on those devices that do not have a standard framebuffer.



WORKAROUND
To prevent your application from being forced into portrait mode, try the following:
 * Query the original orientation and then remember the original orientation by calling the ChangeDisplaySettingsEx(NULL,&devMode,NULL,CDS_TEST,NULL) function.
 * Call the GXOpenDisplay function.
 * Set the orientation back to its original state by calling the ChangeDisplaySettingsEx(NULL,&devMode,NULL,CDS_RESET,NULL) function.

To prevent corruption of the title bar and the menu bar when your GAPI application does not fill the whole screen, do not use viewports in landscape mode. Alternatively, you can use Graphics Device Interface (GDI).



STATUS
Microsoft has confirmed that this is a problem in Windows Mobile 2003 Second Edition software for Pocket PC.

Keywords: kbtshoot kbprb KB843485

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.