comparison 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
comparison
equal deleted inserted replaced
3461:87182c69e080 3462:6265b67848e0
163 renderer->SetDrawBlendMode = photon_setdrawblendmode; 163 renderer->SetDrawBlendMode = photon_setdrawblendmode;
164 renderer->RenderPoint = photon_renderpoint; 164 renderer->RenderPoint = photon_renderpoint;
165 renderer->RenderLine = photon_renderline; 165 renderer->RenderLine = photon_renderline;
166 renderer->RenderFill = photon_renderfill; 166 renderer->RenderFill = photon_renderfill;
167 renderer->RenderCopy = photon_rendercopy; 167 renderer->RenderCopy = photon_rendercopy;
168 renderer->RenderReadPixels = photon_renderreadpixels;
169 renderer->RenderWritePixels = photon_renderwritepixels;
168 renderer->RenderPresent = photon_renderpresent; 170 renderer->RenderPresent = photon_renderpresent;
169 renderer->DestroyTexture = photon_destroytexture; 171 renderer->DestroyTexture = photon_destroytexture;
170 renderer->DestroyRenderer = photon_destroyrenderer; 172 renderer->DestroyRenderer = photon_destroyrenderer;
171 renderer->info = photon_renderdriver.info; 173 renderer->info = photon_renderdriver.info;
172 renderer->window = window->id; 174 renderer->window = window->id;
319 if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_OFFSCREEN) 321 if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_OFFSCREEN)
320 { 322 {
321 /* Create offscreen surfaces */ 323 /* Create offscreen surfaces */
322 allocate_task=SDL_PHOTON_SURFTYPE_OFFSCREEN; 324 allocate_task=SDL_PHOTON_SURFTYPE_OFFSCREEN;
323 325
326 /* Before destroying surfaces, be sure, that rendering was completed */
327 PgFlush();
328 PgWaitHWIdle();
329
324 /* Destroy current surfaces */ 330 /* Destroy current surfaces */
325 for (it=0; it<SDL_PHOTON_MAX_SURFACES; it++) 331 for (it=0; it<SDL_PHOTON_MAX_SURFACES; it++)
326 { 332 {
327 if (rdata->osurfaces[it] != NULL) 333 if (rdata->osurfaces[it] != NULL)
328 { 334 {
1516 SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata; 1522 SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
1517 SDL_Window *window = SDL_GetWindowFromID(renderer->window); 1523 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
1518 SDL_WindowData *wdata = (SDL_WindowData *)window->driverdata; 1524 SDL_WindowData *wdata = (SDL_WindowData *)window->driverdata;
1519 uint32_t it; 1525 uint32_t it;
1520 1526
1527 /* Before destroying the renderer, be sure, that rendering was completed */
1528 PgFlush();
1529 PgWaitHWIdle();
1530
1521 /* Destroy graphics context */ 1531 /* Destroy graphics context */
1522 if (rdata->gc!=NULL) 1532 if (rdata->gc!=NULL)
1523 { 1533 {
1524 PgDestroyGC(rdata->gc); 1534 PgDestroyGC(rdata->gc);
1525 rdata->gc=NULL; 1535 rdata->gc=NULL;