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

Commit

Permalink
RenderReadPixels and RenderWritePixels now work properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
llmike committed Nov 20, 2009
1 parent cde9384 commit 3867c7a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/video/photon/SDL_photon_render.c
Expand Up @@ -165,6 +165,8 @@ photon_createrenderer(SDL_Window * window, Uint32 flags)
renderer->RenderLine = photon_renderline;
renderer->RenderFill = photon_renderfill;
renderer->RenderCopy = photon_rendercopy;
renderer->RenderReadPixels = photon_renderreadpixels;
renderer->RenderWritePixels = photon_renderwritepixels;
renderer->RenderPresent = photon_renderpresent;
renderer->DestroyTexture = photon_destroytexture;
renderer->DestroyRenderer = photon_destroyrenderer;
Expand Down Expand Up @@ -321,6 +323,10 @@ static int _photon_recreate_surfaces(SDL_Renderer * renderer)
/* Create offscreen surfaces */
allocate_task=SDL_PHOTON_SURFTYPE_OFFSCREEN;

/* Before destroying surfaces, be sure, that rendering was completed */
PgFlush();
PgWaitHWIdle();

/* Destroy current surfaces */
for (it=0; it<SDL_PHOTON_MAX_SURFACES; it++)
{
Expand Down Expand Up @@ -1518,6 +1524,10 @@ photon_destroyrenderer(SDL_Renderer * renderer)
SDL_WindowData *wdata = (SDL_WindowData *)window->driverdata;
uint32_t it;

/* Before destroying the renderer, be sure, that rendering was completed */
PgFlush();
PgWaitHWIdle();

/* Destroy graphics context */
if (rdata->gc!=NULL)
{
Expand Down

0 comments on commit 3867c7a

Please sign in to comment.