Is it开发者_如何学JAVA possible to render all of the OpenGL ES things into a normal allocated buffer instead of the framebuffer:
/* render into this buffer */
GLubyte* buffer =
(GLubyte*) calloc(width * height * 4, sizeof(GLubyte));
I want to be able to convert those rendered images into textures for other uses.
I'm using OpenGL ES 1.3 with the standard C API.
For this you won't get around a call to glReadPixels, which copies the content of the framebuffer into system memory. But when you want to copy it into a texture you can do this directly using glCopyTex(Sub)Image2D or by using FBOs and rendering directly into the texture without the need for a copy (but I'm not sure if FBOs are supported in ES). But of course, you cannot render directly into system memory (for textures it works using FBOs, as they are stored in GPU memory).
精彩评论