iphone landscape mode problem again
I have te开发者_开发问答sted everything but I cant get it to work.
This is how I set up my program:
CGRect contentRect = CGRectMake(0, 0, 480, 320);
CGRect screenBounds = [[UIScreen mainScreen] bounds];
_window = [[UIWindow alloc] initWithFrame: contentRect];
_view = [[GLView alloc] initWithFrame: screenBounds];
CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2);
_view.transform = transform;
_window.frame = contentRect;
_window.bounds = contentRect;
_window.window.bounds = contentRect;
_window.frame = contentRect;
_view.window.bounds = contentRect;
_view.bounds = contentRect;
_view.bounds = contentRect;
_view.frame = contentRect;
[_window addSubview: _view];
[_window makeKeyAndVisible];
I set up my opengl like this:
glViewport(0, 0, 480, 320);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthof( 0, 480, 0, 320, -1, 1 );
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
and as you can see one third from the right is black? what am i missing?
You should set rotation in your model/view matrix and not in the view.
精彩评论