I am currently writing an Android app for my clients who have GLSurfaceView with GLSurfaceView.Renderer.
All my OpenGL stuff works just fine (this is basically a port of what another developer wrote on iOS in the first place). Except one. When the image loads and thus the OpenGL stuff loads, my background quickly flashes black, and then OpenGL starts rendering correctly (with my background). So what I do:
In onSurfaceCreated, I start with this:
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
GLES20.glClearColor(0.9f + 0.1f * (21.0f / 255),
0.9f + 0.1f * (36.0f / 255),
0.9f + 0.1f * (31.0f / 255), 1.0f);
}
In my onDrawFrame method, I do this:
@Override
public void onDrawFrame(GL10 gl) {
GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
}
, , glClearColor (..) onSurfaceCreated, . glClearColor (..) (, , OpenGL ), .
, , , , ...
, ?