I just got started on a renderer for my cross platform framework (iOS and Android) using opengl es. When I got to the viewport stuff (which is needed for splitscreen stuff) and noticed there is a difference between iOS and Android. Here are two images.
Android There is actually another glitch. IT seems to wrap.
iOS
My question. Which of the two is correct? I have no transformations applied but one to bring the drawn quad back a bit. glTranslatef(0.0f, 0.0f, -5.f);
Initialisation code:
glEnable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH); //Enable Smooth Shading
glClearColor(0.f, 0.f, 0.f, 1.0f); //Black Background
glClearDepthf(1.0f); //Depth Buffer Setup
glEnable(GL_DEPTH_TEST); //Enables Depth Testing
glDepthFunc(GL_LEQUAL); //The Type Of Depth Testing To Do
//Really Nice Perspective Calculations
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
Viewport and project code
glViewport(viewportX, viewportY, viewportW, viewportH);.
glEnable(GL_SCISSOR_TEST);
glScissor(viewportX, viewportY, viewportW, viewportH);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
... And finally the frustrum is calculated and set glFrustrum. I have also used this code:
float widthH = width * .1f;
float heightH = height * .1f;
glOrthof(-widthH, widthH, -heightH, heightH, .1f, 100.f);
glScalef(widthH, heightH, 1.f);
Maybe Android or iOS has something set by default? I am clueless.