fix crash: call setEGLContextClientVersion() before setRenderer()

This commit is contained in:
Josh Holtrop 2012-11-01 22:19:10 -04:00
parent 7f49e9fd24
commit 77f245197f
2 changed files with 4 additions and 2 deletions

View File

@ -9,8 +9,10 @@ public class MyGLSurfaceView extends GLSurfaceView
{
super(context);
setEGLContextClientVersion(2);
setRenderer(new MyRenderer());
setEGLContextClientVersion(2);
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}
}

View File

@ -9,7 +9,7 @@ public class MyRenderer implements GLSurfaceView.Renderer
{
public void onSurfaceCreated(GL10 unused, EGLConfig config)
{
GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
GLES20.glClearColor(1.0f, 0.6f, 0.1f, 1.0f);
}
public void onDrawFrame(GL10 unused)