简体   繁体   中英

How to read from front buffer using glReadPixels?

I am using OpenGL ES in Android to render certain images. As soon as i render the frame, I want to take a copy of it. Although I can use FBO for that, only certain devices support FBO. For other devices, I will have to use glReadPixels which consumes more time. Since glReadPixels can copy only the data from back buffer, the buffer can be swapped only after taking a copy which affects the response time for rendering.

Is there any way to copy data from frontbuffer. So that i can render the images to screen as soon as processing is over and take the copy later from front buffer.

EDIT: In some devices the back buffer gets cleared as soon as the buffer is swapped with the front buffer. In some other devices, it is not cleared. I would prefer the image to stay as it is in the backbuffer even after swapping it to front buffer ( rather copying it to front buffer). Is there any way to force the gl not to clear the backbuffer even after swapping?

使用以下命令将读数切换到前缓冲区

 glReadBuffer(GL_FRONT); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM