Android OpenGL image processing - without SurfaceView

我怕爱的太早我们不能终老 提交于 2019-12-06 05:01:59

问题


I want to do some background image processing using OpenGL ES 2 and shaders, but no drawing to a surface (i.e. off-screen rendering to framebuffers only). While I've already done so on iOS, I'm struggling with this on Android.

I think I'm close to creating a working OpenGL context, but haven't figured out how to do so without a SurfaceView.


回答1:


Have a look at this gamedev post (click on expand to view the complete code). The code creates a GL context and uses the GLSurfaceView.Renderer interface to appropriately allow to write a renderer. On calling getBitmap(), the renderer is called to draw a frame, which is then read back and converted to a Bitmap.

Note that there is a featured question, which might interest you, too.



来源:https://stackoverflow.com/questions/11015139/android-opengl-image-processing-without-surfaceview

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