View Full Version : android onPause - onResume glActiveTexture error 1285 out of memory

05-30-2016, 08:22 AM
hi all.

in android.

after stopping and resumption of activity, render the error only after glActiveTexture

logErr+="act "+GLES20.glGetError()+"\n"; //error 1285

GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture);
logErr+="bind "+GLES20.glGetError()+"\n";//error 0

logErr+="is tex"+GLES20.glIsTexture(texture)+"\n"; //true

Dark Photon
06-07-2016, 06:53 PM
What GPU and Android device? Are there any other GL or EGL errors being emitted? Be sure to check for success returns from egl calls such as eglSwapBuffers, eglMakeCurrent, etc.

Are you following these guidelines when managing android Activity States?:

Fixing Common Android Lifecycle Issues in Games (https://developer.nvidia.com/fixing-common-android-lifecycle-issues-games) (NVidia)

In particular, are you monitoring the onNativeWindowDestroyed and onNativeWindowCreated activity states?

I've seen cases where the window system deletes the EGL window surface out from under you on an onResume. In these circumstances, your app is responsible for detaching the window from your context, waiting for an onNativeWindowCreated, and then attaching the new window to the context (assuming you want to keep your context and render to the window surface). Not following this pattern won't necessary net you a GL_OUT_OF_MEMORY, but it'll likely result in EGL errors trying to talk to a native window that's already been deleted through an EGL window surface still pointing to it.

Also, this probably isn't your problem but (related to GL_OUT_OF_MEMORY returns on Android: ) I've seen a GL_OUT_OF_MEMORY kicked back to the app followed later by an EGL_CONTEXT_LOST error when the Qualcomm Adreno driver deadlocks/crashes internally due to a driver bug handling gl_FragDepth in a frag shader (link (https://www.opengl.org/discussion_boards/showthread.php/198457-How-to-share-a-texture-among-several-thread)).

With more details on what GPU you're using and what specifically you're trying to do, folks here might be able to offer further ideas and tips.