setEGLContextClientVersion(2); // Create an OpenGL ES 2.0 context.
setEGLConfigChooser(8, 8, 8, 8, 0, 0);
getHolder().setFormat(PixelFormat.RGBA_8888);
setRenderer(new MyGLRenderer()); // Set the Renderer for drawing on the GLSurfaceView
// setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY) ; // Render the view only when there is a change in the drawing data (must be after setRenderer!)
}
}

// get handle to fragment shader's vColor member
mColorHandle = GLES20.glGetUniformLocation(mProgram, "vColor");
mPositionHandle = GLES20.glGetAttribLocation(mProgram, "vPosition"); // get handle to vertex shader's vPosition member
GLES20.glEnableVertexAttribArray(mPositionHandle); // Enable a handle to the vertices - since this is the only one used, keep it enabled all the time
}