I am having a problem where I need to some off-screen work with opengl es2 by software rendering(Only has CPU, no GPU). The question is can I use pbuffer without GPU? Also, how to directly save to a png file after drawing something. Please help and give me a demo.
Share
First, use EGL to create an off-screen buffer:
Then read the buffer:
The last save to pixel buffer to a bmp file.
(reminder: In 24 bit bmp image, the order is BGR, not RGB; So need to switch the image data from BGR to RGB.)