In cocos2d-iphone 2.0, CCDirector inherits from UIViewController, and it has a delegate as a member variable.
So you can easily to change orientation by implementing [shouldAutorotateToInterfaceOrientation:interfaceOrientation].
I don’t know how to do it in cocos2d-x, because it is platform dependent.
Now you should set orientation at beginning:
1. modify AndroidManifest.xml under ROOT_PROJECT/proj.android
2. modify “- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation” in PROJECT_ROOT/ios/RootViewController.mm