我刚刚开始学习openGL,并且正在研究android并且陷入困境。请看下面的代码:-
public void onDrawFrame(GL10 arg0) {
glClear(GL_COLOR_BUFFER_BIT);
}
@Override
public void onSurfaceChanged(GL10 glUnused, int width, int height) {
glViewport(0,0,width,height);
}
@Override
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) {
glClearColor(1.0f,0.0f,0.0f,0.0f);
}
在 onSurfaceCreated 中设置颜色,在 onDrawFrame 中清除颜色缓冲区。现在一旦清除了颜色缓冲区,为什么表面的颜色仍然和 onSurfaceCreated 中设置的一样?