MCPcopy Create free account
hub / github.com/ZDoom/Raze / CopyScreenToBuffer

Method CopyScreenToBuffer

source/common/rendering/gl/gl_framebuffer.cpp:204–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void 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//

Callers 1

RenderToSavePicFunction · 0.45

Calls 1

CopyToBackbufferMethod · 0.45

Tested by

no test coverage detected