wolfscaptain
Lurker
I am trying to make an OpenGL ES2 application. As a start, I just copied the demo BasicGLSurfaceView from the API level 11 samples.
After it crashed no matter what I changed, I made a very stripped version which basically just creates the surface. After many testing and finally trying out the debugger, it seems like calling setEGLContextClientVersion() with 2 causes an exception in GLThread:
This is my first try at an Android application, so I have no idea what this means. Tried to find what GLThread is, but it isn't documented in the API.
This is the current - very simple - code (taken from here):
When I run either this or the demo without the debugger, they crash.
Any ideas why this happens?
Oh and I am currently using the level 9 API, but I tried with both 10 and 11 too to no avail, so I guess that's not the issue.
Thanks for any help
After it crashed no matter what I changed, I made a very stripped version which basically just creates the surface. After many testing and finally trying out the debugger, it seems like calling setEGLContextClientVersion() with 2 causes an exception in GLThread:
PHP:
Thread [<1> main] (Running)
Thread [<8> Binder Thread #2] (Running)
Thread [<7> Binder Thread #1] (Running)
Thread [<9> GLThread 10] (Suspended (exception IllegalArgumentException))
GLSurfaceView$GLThread.run() line: 1122
This is the current - very simple - code (taken from here):
PHP:
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.app.Activity;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
public class Test extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mGLView = new GLSurfaceView(this);
mGLView.setEGLContextClientVersion(2);
mGLView.setRenderer(new ClearRenderer());
setContentView(mGLView);
}
@Override
protected void onPause() {
super.onPause();
mGLView.onPause();
}
@Override
protected void onResume() {
super.onResume();
mGLView.onResume();
}
private GLSurfaceView mGLView;
}
class ClearRenderer implements GLSurfaceView.Renderer {
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
}
public void onSurfaceChanged(GL10 gl, int w, int h) {
}
public void onDrawFrame(GL10 gl) {
}
}
Any ideas why this happens?
Oh and I am currently using the level 9 API, but I tried with both 10 and 11 too to no avail, so I guess that's not the issue.
Thanks for any help
