Android Utililty Methods GL10 Draw

List of utility methods to do GL10 Draw

Description

The list of methods to do GL10 Draw are organized into topic(s).

Method

voiddrawSquare(GL10 gl, float r, float g, float b, float a)
draw Square
drawSquare(gl, 0.0f, 0.0f, r, g, b, a);
voiddrawSquare(GL10 gl, float x, float y, float r, float g, float b, float a)
draw Square
float[] vertices = { -0.5f + x, -0.5f + y, 0.5f + x, -0.5f + y,
        -0.5f + x, 0.5f + y, 0.5f + x, 0.5f + y, };
float[] colors = { r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a, };
FloatBuffer squareVertices = makeFloatBuffer(vertices);
FloatBuffer squareColors = makeFloatBuffer(colors);
gl.glVertexPointer(2, GL10.GL_FLOAT, 0, squareVertices);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glColorPointer(4, GL10.GL_FLOAT, 0, squareColors);
...
voiddrawScreenSpaceQuad(GL10 gl)
draw Screen Space Quad
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
GLU.gluOrtho2D(gl, 0, WIDTH, HEIGHT, 0);
gl.glVertexPointer(2, GL10.GL_BYTE, 0, VERTICES);
gl.glDrawArrays(GL10.GL_TRIANGLE_FAN, 0, 4);
gl.glPopMatrix();