diff src/video/SDL_video.c @ 3053:aa34d1180d30

When creating a software texture, synchronize the surface with the texture. When creating a texture from a surface, synchronize the texture with the surface.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 30 Jan 2009 06:40:16 +0000
parents 89f8a72e1ee9
children 089a77aebb7d
line wrap: on
line diff
--- a/src/video/SDL_video.c	Fri Jan 30 06:38:44 2009 +0000
+++ b/src/video/SDL_video.c	Fri Jan 30 06:40:16 2009 +0000
@@ -1635,6 +1635,24 @@
         }
     }
 
+    {
+        Uint8 r, g, b, a;
+        int blendMode;
+        int scaleMode;
+
+        SDL_GetSurfaceColorMod(surface, &r, &g, &b);
+        SDL_SetTextureColorMod(textureID, r, g, b);
+
+        SDL_GetSurfaceAlphaMod(surface, &a);
+        SDL_SetTextureAlphaMod(textureID, a);
+
+        SDL_GetSurfaceBlendMode(surface, &blendMode);
+        SDL_SetTextureBlendMode(textureID, blendMode);
+
+        SDL_GetSurfaceScaleMode(surface, &scaleMode);
+        SDL_SetTextureScaleMode(textureID, scaleMode);
+    }
+
     if (SDL_ISPIXELFORMAT_INDEXED(format) && fmt->palette) {
         SDL_SetTexturePalette(textureID, fmt->palette->colors, 0,
                               fmt->palette->ncolors);