fix crash: call setEGLContextClientVersion() before setRenderer()
This commit is contained in:
parent
7f49e9fd24
commit
77f245197f
@ -9,8 +9,10 @@ public class MyGLSurfaceView extends GLSurfaceView
|
|||||||
{
|
{
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
|
setEGLContextClientVersion(2);
|
||||||
|
|
||||||
setRenderer(new MyRenderer());
|
setRenderer(new MyRenderer());
|
||||||
|
|
||||||
setEGLContextClientVersion(2);
|
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ public class MyRenderer implements GLSurfaceView.Renderer
|
|||||||
{
|
{
|
||||||
public void onSurfaceCreated(GL10 unused, EGLConfig config)
|
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)
|
public void onDrawFrame(GL10 unused)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user