| 202 | } |
| 203 | |
| 204 | void OpenGLFrameBuffer::CopyScreenToBuffer(int width, int height, uint8_t* scr) |
| 205 | { |
| 206 | IntRect bounds; |
| 207 | bounds.left = 0; |
| 208 | bounds.top = 0; |
| 209 | bounds.width = width; |
| 210 | bounds.height = height; |
| 211 | GLRenderer->CopyToBackbuffer(&bounds, false); |
| 212 | |
| 213 | // strictly speaking not needed as the glReadPixels should block until the scene is rendered, but this is to safeguard against shitty drivers |
| 214 | glFinish(); |
| 215 | glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, scr); |
| 216 | } |
| 217 | |
| 218 | //=========================================================================== |
| 219 | // |
no test coverage detected