<p>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...</p>

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 the native format. glReadPixels will understand this format as a parameter to glReadPixels and allows you to directly get the pixel-data in native format. This is usually a bit faster than GL_RGBA.
Take a look at the header-file or query the extension-support via glGetString.