Skip to content

Commit

Permalink
Fixed|GL: Grab window contents from the front (visible) buffer
Browse files Browse the repository at this point in the history
The GL default is to read from the back buffer, but screen captures
should be made using the visible, completed frames.
  • Loading branch information
skyjake committed Sep 22, 2012
1 parent eb105c1 commit bc51f81
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doomsday/engine/portable/src/canvas.cpp
Expand Up @@ -214,7 +214,10 @@ void Canvas::useCallbacksFrom(Canvas &other)

QImage Canvas::grabImage(const QSize& outputSize)
{
// We will be grabbing the visible, latest complete frame.
glReadBuffer(GL_FRONT);
QImage grabbed = grabFrameBuffer(); // no alpha
glReadBuffer(GL_BACK);
if(outputSize.isValid())
{
grabbed = grabbed.scaled(outputSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
Expand Down

0 comments on commit bc51f81

Please sign in to comment.