Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug OPENGL ES 2.0 error on Nexus 4 without having the device?

I have an android app with a bunch of photo filters. Filters are implemented with OpenGL ES 2.0 so when i want to save the final image i make glReadPixels call. It works on every device i have tested on, however it seems it does not work on Nexus 4. Users report that they can apply the filters but when they save the final image they can't find it on the devices. I want to know if there is any way for me to emulate nexus 4 and test my app on emulator? I have tested on emulator and it works fine also it would be good to know if anyone had similar problem with Nexus 4.

My glReadPixels call.

GLES20.glReadPixels(0, 0, saveWidth, saveHeight, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, mPixels);
like image 546
Tony Avatar asked Jan 31 '13 13:01

Tony


1 Answers

Add additional logging and get some test users to send you the output; this can help you narrow down where the specific problem is, whether it's with glReadPixels, or the file save. In particular, use glGetError() and log its value, and add try/catch blocks around file I/O:

try {
    .... file ops
} catch (Exception e) {
    e.printStackTrace();
}
like image 95
Sofi Software LLC Avatar answered Oct 14 '22 09:10

Sofi Software LLC