I'm using opengl es 2.0 on android 2.2. My problem here isn't with the canvas, or creating a fullscreen android view, that I already have figured out.
I'm wondering how you would set the coordinates of a GL_QUAD, or 2 GL_TRIANGLES to perfectly cover the entire screen, for use as a texturing surface for a 2D game, for example.
I currently have the gluPerspective set to:
float ratio = (float) width / height;
GLU.gluPerspective( gl, 45.0f, ratio, 1.0f, 100.0f );
inside onSurfaceChanged, so the width and height variables are the width and height of the screen, respectively.
next I have the coordinates of the quad as:
public static final float screenVerts[] = {
-1f, -1f,
1f, -1f,
1f, 1f,
-1f, 1f
};
however the displayed quadrilateral isn't in proportion to the screen, it's simply displayed as a square, with the coordinates apparently being relative to opengl's own geometry, not the screen's height / width.
how do I make the screenVerts variable, (2D points for the rect that I draw on) to be relative to the screen itself? I.e. 1.0f being 100% of the screen's height in the Y-coordinate of one of the points in the quad.
And I really do apologize for not phrasing this well, no offense will be taken if I need to explain myself again.