@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
MatrixState.setInitStack();
MatrixState.rotate(180,1, 0, 0);//180
initShader();
initPitctures();
initObject();
initParticle();
initWorld();
initThread();
}
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
// TODO Auto-generated method stub
GLES20.glViewport(0, 0, width, height);
ratio = (float) width / height;
RATIO = ratio;
initRect();
ConfigButtonArea();
}
@Override
public void onDrawFrame(GL10 gl) {
// TODO Auto-generated method stub
GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
if (isScreenSaver) {
drawScreenSaver();
} else {
if (SPIRIT_OFFSET > 2 * ratio) {
SPIRIT_OFFSET = 0;
spirtMoveFlag = true;
moveFlag = false;
}
if ((saveIndex[0] == 0 && saveIndex[1] == 1) || (saveIndex[0] == 1 && saveIndex[1] == 0)) {
compoundIndex = 2;
}
if ((saveIndex[0] == 2 && saveIndex[1] == 3) || (saveIndex[0] == 3 && saveIndex[1] == 2)) {
compoundIndex = 3;
}
if (!spirtMoveFlag) {
drawSpirit();
drawColorEdge();
} else {
drawSpiritBlank1();
}
drawRightBackground();
}
}