After hours searching... I gave up, and ask for som help
I need to make the game I'm developing for thi iPhone to run only in Landscape orientation
I tryied adding de UIInterfaceOtientation vaule in the info.plist and adding a viewcontroler (as many tutorial say) but with this... I get an error (something like "error when trying to install application'")
Then I tryied to modify in any way the projection matrix (driver->setTransoform), getting the current matrix and setting its rotation to (0,0,90), and setting this new matrix to the driver transfomation... but it had no effect (I don't know very much about matrix manipulation)
So finally I decide to rotate the camera (and change a lot of things), but before doing all this, I preffer ask if anybody knows a good way to do it.
So I somebody can give any hint of how can I do this i would be gratefull
Landscape in iPhone
Just force landscape orientation of your main view controller
Code: Select all
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
That's the problem, I've not ViewController coz' I'm using the template posted here: http://irrlicht.sourceforge.net/phpBB2/ ... e&start=75
Wich hasn't any one, but it use an OGL-ES View
Wich hasn't any one, but it use an OGL-ES View
You could try something like this in your application delegate class, calling the method during your init flow:Metalero wrote:That's the problem, I've not ViewController coz' I'm using the template posted here: http://irrlicht.sourceforge.net/phpBB2/ ... e&start=75
Wich hasn't any one, but it use an OGL-ES View
Code: Select all
-(void)setLandscapeMode
{
UIApplication* application = [UIApplication sharedApplication] ;
if ( application.statusBarOrientation == UIInterfaceOrientationPortrait )
{
// set landscape mode
application.statusBarOrientation = UIInterfaceOrientationLandscapeLeft;
window.hidden = false ;
window.bounds = CGRectMake(0.0, 0.0, window.bounds.size.height, window.bounds.size.width); // change orientation
CGAffineTransform landscapeTransform = CGAffineTransformConcat( CGAffineTransformIdentity, CGAffineTransformMakeRotation (M_PI / -2) );
window.transform = landscapeTransform ;
}
}
L/