thanks for helping!how could I change the orientation to UIInterfaceOrientationLandscapeLeft in game with the default value is Portrait?

[[UIApplication sharedApplication] setStatusBarOrientation:orientation];
[UIViewController attemptRotationToDeviceOrientation];

if (UIInterfaceOrientationIsLandscape(UIApplication.sharedApplication.statusBarOrientation))
{
s = CGSizeMake(std::max(winSize.width, winSize.height), std::min(winSize.width, winSize.height));
}
else
{
s = CGSizeMake(std::min(winSize.width, winSize.height), std::max(winSize.width, winSize.height));
}

cocos2d::CCDirector* director = cocos2d::CCDirector::sharedDirector();
director~~>getOpenGLView~~>setFrameSize;
CCLog;
director~~>getOpenGLView~~>setDesignResolutionSize;
director~~>setProjection);
here is my code, and I found that the simulator has rotated successfully, but the OpenGL view don’t rotate suitable
I am trying to rotate the EAGLView, but I found that the original point of OpenGL is not located at left and bottom,
and the width, height of the view was not changed,
and then, I dealloc the EAGLView and product a new one…but a OpenGL error is displayed…
Is there anyone who got the really answear?
~~(void) doCaller: (id) sender
{
if (reInitEAGLView)
{

AppController **appDelegate = .delegate;
// removeFromSuperview];
// appDelegate.viewController.view = nil;
// cocos2d::CCEGLView::sharedOpenGLView~~>end;
cocos2d::CCDirector::sharedDirector~~>end;
// setReInitEAGLView:YES];

// pDirector~~>setOpenGLView);
// m_pTouchDispatcher~~>setDispatchEvents;
// CCDirector::sharedDirector->replaceScene);
}
cocos2d::CCDirector::sharedDirector->mainLoop;
if
{
AppControllerappDelegate = (AppController).delegate;
EAGLView***glView = ;
appDelegate.viewController.view =*glView;

// Set RootViewController to window
if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)
{
// warning: addSubView doesn’t work on iOS6
[appDelegate.window addSubview:appDelegate.viewController.view];
}
else
{
// use this method on ios6
[appDelegate.window setRootViewController:appDelegate.viewController];
}

cocos2d::CCApplication::sharedApplication()->run();

reInitEAGLView = NO;
reInitGameEngine = NO;
}
}
I try to stop the director and renew a EAGLView, but a “OpenGL error 0x0502 in -[EAGLView swapBuffers] 325” is shown every frame, I have no answer…

I got a new Idea, maybe I can modified the translate matrix!

YES, I finailly modified the translate maxtrix, I found that it’s the best way I cound find.

that’s all~:)
happy new years
cocos2d 万岁

2013.1.8

I found that the best way is not to modify the translate maxtrix, but rotate the game layer, and swap the winSize.width and winSize.height
SO it is