orientation changes during runtime causes screen to appear half on the device

i am trying to make my app orientation independent. when i do that both the marmalade as well as cocos2d-x work on my app to get it half black.

if the app is stated in portrait mode, and if there is no change in orientation the app looks perfect.(same applies to landscape)
but, if orientation is changed while the app is running, it gives half black screen with no buttons working.
and if we tilt it back to original orientation, then it again looks perfect.


Capture.PNG (195.7 KB)


Capture.PNG (195.7 KB)

added this code from http://www.cocos2d-x.org/projects/cocos2d-x/wiki/About_device_orientation and then saved it as an *.xml
then added the xml code snippet at the time of marmalade deloyment. but, worth less.

tried portrait mode by adding it to manifest (as code snippet). doesn’t affects at all.

i added this code to ccapplication_marmalade.cpp’s while loop.
seems as if app is totally ignoring my code.
i tried break points. those lines are being compiled continually.

ccAccelerationUpdate();
if(s3eAccelerometerGetX>s3eAccelerometerGetY)
{
     CCDirector::sharedDirector()->setDeviceOrientation(kCCDeviceOrientationPortrait);
}
else if(s3eAccelerometerGetY>s3eAccelerometerGetX)
{
     CCDirector::sharedDirector()->setDeviceOrientation(kCCDeviceOrientationPortrait);
}

even this is not working

void GameScene::tick(ccTime dt)
{   
    //CCLOG(" log to skip deploy error");
    CCSize WinSize= CCDirector::sharedDirector()->getWinSize();
    if(s3eAccelerometerGetXsetDeviceOrientation(kCCDeviceOrientationPortrait);
    }
    else if(s3eAccelerometerGetX>s3eAccelerometerGetY)
    {
        double x=WinSize.height;
        WinSize.height=WinSize.width;
        WinSize.width=x;
        CCDirector::sharedDirector()->setDeviceOrientation(kCCDeviceOrientationLandscapeLeft);
    }
}

bump