OpenGl render direcly to bitmap (without any view)
I need to apply some pixel shaders to a bitmap (using OpenGL) and send result to server. Rendering is supposed to be made in background so I can't create GLSurfaceView for this purpose. So my question is: is it possible to make OpenGL rendering on Android without using GLSurfaceView? Like rendering directly to bitmap, or canvas or some sort of buffer/array? Or may by it is possible to use some kind of dummy GLSurfaceView?
This SO post contains a link to an anddev post. A bit downwards, somebody created a PixelBuffer
class that reuses the GLSurfaceView.Renderer
interface, but apart from that, only EGL.
It sounds like you want to render to a frame buffer object (ie directly to a texture). This is definitely possible. Just search around for the answer here or on the web. I found this one without trying too hard. I'm not sure if you're using GL ES 1.1 or 2.0 though.
http://blog.shayanjaved.com/2011/05/13/android-opengl-es-2-0-render-to-texture/
It also looks like APIDemos in the SDK has a sample for 1.1
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FrameBufferObjectActivity.html
链接地址: http://www.djcxy.com/p/58410.html上一篇: 使用Selenium Webdriver for Ruby进行HTML5拖放
下一篇: OpenGl直接渲染位图(没有任何视图)