Code example for GL10

Methods: glClearglColor4fglColorPointerglDrawElementsglVertexPointer

         * Usually, the first thing one might want to do is to clear 
         * the screen. The most efficient way of doing this is to use 
         * glClear(). 
        // set the color of our element 
        gl.glColor4f(0.5f, 0f, 0f, 1.0f);
        // define the coords we want to draw 
        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, _vertexBuffer);
        gl.glColorPointer(4, GL10.GL_FLOAT, 0, _colorBuffer);
        // finally draw the vertices 
        gl.glDrawElements(GL10.GL_TRIANGLES, _indicesArray.length, GL10.GL_UNSIGNED_SHORT, _indexBuffer);
	public void onSurfaceChanged(GL10 gl, int w, int h) {
		gl.glViewport(0, 0, w, h);
Contextual code suggestions in your IDE  Get Codota for Java