How do I grab an image from my EAGLLayer ?
问题 I'm looking for way to grab the content of my opengl (as UIImage) and then save it into a file. I'm now giving glReadPixels a try though I'm not sure I'm doing the right thing as of what kind of malloc I should be doing. I gather that on OSX it's GL_BGRA but on the iPhone that doesn't work... 回答1: All OpenGL|ES complient GL-implementations have to support GL_RGBA as a parameter to glReadPixels. If your OpenGL|Es supports the GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES extension you can also query