我在我的uiview中有glview,现在我必须拍摄uiview和glview的组合视图.我google了很多,但我发现任何有用的东西,我知道如何采取glview的scrrenshot
nt width = glView.frame.size.width; int height = glView.frame.size.height;
NSInteger myDataLength = width * height * 4;
// allocate array and read pixels into it.
GLubyte *buffer = (GLubyte *) malloc(myDataLength);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
// gl renders "upside down" so swap top to bottom into new array.
// there's gotta be a better way, but this works.
GLubyte *buffer2 = (GLubyte *) malloc(myDataLength);
for(int y = 0; y < height; y++)
{
for(int x = 0; …Run Code Online (Sandbox Code Playgroud)