diff src/video/photon/SDL_photon_render.c @ 3462:6265b67848e0

RenderReadPixels and RenderWritePixels now work properly.
author Mike Gorchak <lestat@i.com.ua>
date Fri, 20 Nov 2009 07:07:41 +0000
parents feea0def118d
children 8c5fb2a3b11d
line wrap: on
line diff
--- 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)
     {