[android-developers] glGenTextures return 0 and got call to OpenGL ES API with no current context (logged once per thread)

2012-08-28 Thread Li Sun
Hi, I just met a issue of glGenTextures. I wrote the below codes on Activity.onCreate() function int[] mTextureNames = new int[1]; GLES20.glGenTextures(1,mTextureNames,0); SurfaceTexture mSurfaceTexture = new SurfaceTexture(mTextureNames[0]); but mTextureNames[0] is

Re: [android-developers] glGenTextures return 0 and got call to OpenGL ES API with no current context (logged once per thread)

2012-08-28 Thread Latimerius
Hello, Activity.onCreate() runs on application's main thread which is not associated with a GL context, hence the error message. The usual way is to have a rendering thread which you can either associate with a GL context yourself by using EGL calls, or you can have the Android framework help