diff src/video/SDL_renderer_sw.c @ 5144:31e7f523ab3d

Making the API simpler, texture color and alpha modulation are supported by all renderers.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 31 Jan 2011 23:37:30 -0800
parents e743b9c3f6d6
children c8e049de174c
line wrap: on
line diff
--- a/src/video/SDL_renderer_sw.c	Mon Jan 31 23:23:57 2011 -0800
+++ b/src/video/SDL_renderer_sw.c	Mon Jan 31 23:37:30 2011 -0800
@@ -49,6 +49,8 @@
                                  SDL_Texture * texture);
 static int SW_SetTextureAlphaMod(SDL_Renderer * renderer,
                                  SDL_Texture * texture);
+static int SW_SetTextureBlendMode(SDL_Renderer * renderer,
+                                  SDL_Texture * texture);
 static int SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
                             const SDL_Rect * rect, const void *pixels,
                             int pitch);
@@ -82,8 +84,6 @@
      (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
       SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
       SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC),
-     (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
-      SDL_TEXTUREMODULATE_ALPHA),
      14,
      {
       SDL_PIXELFORMAT_INDEX8,
@@ -172,12 +172,12 @@
     renderer->GetTexturePalette = SW_GetTexturePalette;
     renderer->SetTextureColorMod = SW_SetTextureColorMod;
     renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod;
+    renderer->SetTextureBlendMode = SW_SetTextureBlendMode;
     renderer->UpdateTexture = SW_UpdateTexture;
     renderer->LockTexture = SW_LockTexture;
     renderer->UnlockTexture = SW_UnlockTexture;
     renderer->DestroyTexture = SW_DestroyTexture;
 
-    renderer->info.mod_modes = SW_RenderDriver.info.mod_modes;
     renderer->info.num_texture_formats =
         SW_RenderDriver.info.num_texture_formats;
     SDL_memcpy(renderer->info.texture_formats,