comparison src/SDL_compat.c @ 1985:8055185ae4ed

Added source color and alpha modulation support. Added perl script to generate optimized render copy functions.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 28 Aug 2006 03:17:39 +0000
parents 70deaf574153
children 6bb97f41ab4b
comparison
equal deleted inserted replaced
1984:b910bcabec26 1985:8055185ae4ed
671 screen = SDL_VideoSurface; 671 screen = SDL_VideoSurface;
672 } 672 }
673 if (screen == SDL_VideoSurface) { 673 if (screen == SDL_VideoSurface) {
674 if (SDL_VideoRendererInfo.flags & SDL_RENDERER_PRESENTCOPY) { 674 if (SDL_VideoRendererInfo.flags & SDL_RENDERER_PRESENTCOPY) {
675 for (i = 0; i < numrects; ++i) { 675 for (i = 0; i < numrects; ++i) {
676 SDL_RenderCopy(SDL_VideoTexture, &rects[i], &rects[i], 676 SDL_RenderCopy(SDL_VideoTexture, &rects[i], &rects[i]);
677 SDL_TEXTUREBLENDMODE_NONE,
678 SDL_TEXTURESCALEMODE_NONE);
679 } 677 }
680 } else { 678 } else {
681 SDL_Rect rect; 679 SDL_Rect rect;
682 rect.x = 0; 680 rect.x = 0;
683 rect.y = 0; 681 rect.y = 0;
684 rect.w = screen->w; 682 rect.w = screen->w;
685 rect.h = screen->h; 683 rect.h = screen->h;
686 SDL_RenderCopy(SDL_VideoTexture, &rect, &rect, 684 SDL_RenderCopy(SDL_VideoTexture, &rect, &rect);
687 SDL_TEXTUREBLENDMODE_NONE,
688 SDL_TEXTURESCALEMODE_NONE);
689 } 685 }
690 SDL_RenderPresent(); 686 SDL_RenderPresent();
691 } 687 }
692 } 688 }
693 689
1419 } 1415 }
1420 1416
1421 int 1417 int
1422 SDL_DisplayYUVOverlay(SDL_Overlay * overlay, SDL_Rect * dstrect) 1418 SDL_DisplayYUVOverlay(SDL_Overlay * overlay, SDL_Rect * dstrect)
1423 { 1419 {
1424 if (SDL_RenderCopy(overlay->hwdata->textureID, NULL, dstrect, 1420 if (SDL_RenderCopy(overlay->hwdata->textureID, NULL, dstrect) < 0) {
1425 SDL_TEXTUREBLENDMODE_NONE,
1426 SDL_TEXTURESCALEMODE_FAST) < 0) {
1427 return -1; 1421 return -1;
1428 } 1422 }
1429 SDL_RenderPresent(); 1423 SDL_RenderPresent();
1430 return 0; 1424 return 0;
1431 } 1425 }