Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
SDL_RenderReadPixels() needs to flush asynchronous operations before …
Browse files Browse the repository at this point in the history
…it reads.

The semantics are that it reads the back buffer, and those pixels may not be available once SDL_RenderPresent() has happened.
  • Loading branch information
slouken committed Nov 21, 2009
1 parent 359d957 commit 0062f5c
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions test/automated/render/render.c
Expand Up @@ -329,9 +329,6 @@ static int render_clearScreen (void)
return -1;
*/

/* Flush all asynchronous operations */
SDL_RenderPresent();

return 0;
}

Expand Down Expand Up @@ -413,9 +410,6 @@ static int render_testPrimitives (void)
if (SDL_ATassert( "SDL_RenderLine", ret == 0))
return -1;

/* Flush all asynchronous operations */
SDL_RenderPresent();

/* See if it's the same. */
if (render_compare( "Primitives output not the same.", &img_primitives ))
return -1;
Expand Down Expand Up @@ -533,9 +527,6 @@ static int render_testPrimitivesBlend (void)
}
}

/* Flush all asynchronous operations */
SDL_RenderPresent();

/* See if it's the same. */
if (render_compare( "Blended primitives output not the same.", &img_blend ))
return -1;
Expand Down Expand Up @@ -588,9 +579,6 @@ static int render_testBlit (void)
/* Clean up. */
SDL_DestroyTexture( tface );

/* Flush all asynchronous operations */
SDL_RenderPresent();

/* See if it's the same. */
if (render_compare( "Blit output not the same.", &img_blit ))
return -1;
Expand Down Expand Up @@ -648,9 +636,6 @@ static int render_testBlitColour (void)
/* Clean up. */
SDL_DestroyTexture( tface );

/* Flush all asynchronous operations */
SDL_RenderPresent();

/* See if it's the same. */
if (render_compare( "Blit output not the same (using SDL_SetTextureColorMod).",
&img_blitColour ))
Expand Down Expand Up @@ -713,9 +698,6 @@ static int render_testBlitAlpha (void)
/* Clean up. */
SDL_DestroyTexture( tface );

/* Flush all asynchronous operations */
SDL_RenderPresent();

/* See if it's the same. */
if (render_compare( "Blit output not the same (using SDL_SetSurfaceAlphaMod).",
&img_blitAlpha ))
Expand Down Expand Up @@ -763,9 +745,6 @@ static int render_testBlitBlendMode( SDL_TextureID tface, int mode )
}
}

/* Flush all asynchronous operations */
SDL_RenderPresent();

return 0;
}

Expand Down Expand Up @@ -883,9 +862,6 @@ static int render_testBlitBlend (void)
/* Clean up. */
SDL_DestroyTexture( tface );

/* Flush all asynchronous operations */
SDL_RenderPresent();

/* Check to see if matches. */
if (render_compare( "Blit blending output not the same (using SDL_BLENDMODE_*).",
&img_blendAll ))
Expand Down

0 comments on commit 0062f5c

Please sign in to comment.