how to use glreadpixels with android — usually get zeros

落爺英雄遲暮 提交于 2019-12-01 10:33:42

I also faced similar issues when creating an openGL ES app on android.

My workaround so far was to change the app from RGB565 to RGBA8888. Insert these lines before setting the renderer:

getHolder().setFormat(PixelFormat.RGBA_8888);
setEGLConfigChooser(8, 8, 8, 8, 0, 0);

You must be aware that this solution will only work on devices that support RGBA8888.

These permissions are only available for signature apps. Apps that were signed when the Android ROM was compiled. So they do nothing for regular apps.

android:name="android.permission.ACCESS_SURFACE_FLINGER"
android:name="android.permission.READ_FRAME_BUFFER" 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!