RenderReadPixels and RenderWritePixels now work properly.
authorMike Gorchak <lestat@i.com.ua>
Fri, 20 Nov 2009 07:07:41 +0000
changeset 3462 6265b67848e0
parent 3461 87182c69e080
child 3463 06c66b8d5033
RenderReadPixels and RenderWritePixels now work properly.
src/video/photon/SDL_photon_render.c
--- a/src/video/photon/SDL_photon_render.c	Fri Nov 20 07:06:50 2009 +0000
+++ b/src/video/photon/SDL_photon_render.c	Fri Nov 20 07:07:41 2009 +0000
@@ -165,6 +165,8 @@
     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;
@@ -321,6 +323,10 @@
           /* 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++)
           {
@@ -1518,6 +1524,10 @@
     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)
     {