PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

ChangeDisplaySettingsEx, button mapping and debug/release

OK, I finally gave up trying to get landscape orientations to work consistently, and decided instead to try to force games back into portrait mode.

Using ChangeDisplaySettingsEx at a point before PHAL initializes, the orientation seems to change fine (at least on the WM5 emulators):

Code:
#ifdef _WIN32_WCE
//Change display?
DEVMODE devmode;
devmode.dmSize = sizeof(DEVMODE);
devmode.dmDisplayOrientation = DMDO_0;
devmode.dmFields = DM_DISPLAYORIENTATION;
LONG rc = ChangeDisplaySettingsEx(NULL,&devmode;,NULL,CDS_RESET,NULL);
#endif


If I run a debug build on a WM5 emulator preset to landscape (left or right handed) the display changes back to portrait, and button mapping is fine.

If I run a release build under the same conditions, the buttons end up rotated.

I've checked for any conditional code under debug that might influence this, and in fact PocketFrog button mapping is completely commented out so this doesn't influence either.

I've tried putting a sleep in the code to allow the OS time to catch up, but I can see on the device that the buttons work correctly before the game starts (moving around the program icons), as soon as the game starts the buttons are wrong again.

Anyone got any ideas here? I can't understand what difference release build would have over debug when it comes to button mapping?