For whatever reason, my EGL Context Client Version isn’t getting set in my OpenGL application. I setup the context by simply doing the following:
final boolean supportEs2 = configurationInfo.reqGlEsVersion >= 0x20000;
if (supportEs2) { //<-- this resolves to true.
mGLView.setEGLContextClientVersion(2);
try {
mGLView.setRenderer(new PongDroidRenderer(getApplicationContext()));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
And after that, I get a runtime exception when trying to compile a shader due to the context not being called correctly. After some research, I figured out that I’m unable to call OpenGL from the main thread, however, as far as I know my application itself isn’t multi-threaded (of course, the system is however). So, I’m kind of hoping to see if anyone here would have any idea as to how I can get this working, and if more information is provided just say the word and I’ll post it here.
Are you using a glSurfaceView? The opengl context is only valid from the surfaceview thread (the one that calls onDrawFrame, onSurfaceChanged, onSurfaceCreated, etc). You should compile your shaders in those callbacks.