We don't want to save the alpha modulation, we want to save the blend mode.
authorSam Lantinga <slouken@libsdl.org>
Thu, 27 Jun 2013 11:49:19 -0700
changeset 7324 0b4494cd6412
parent 7323 590e596a8efc
child 7325 056bbe33cf47
We don't want to save the alpha modulation, we want to save the blend mode.
test/testshader.c
--- a/test/testshader.c	Thu Jun 27 11:44:07 2013 -0700
+++ b/test/testshader.c	Thu Jun 27 11:49:19 2013 -0700
@@ -281,8 +281,7 @@
     int w, h;
     SDL_Surface *image;
     SDL_Rect area;
-    Uint32 saved_flags;
-    Uint8 saved_alpha;
+    SDL_BlendMode saved_mode;
 
     /* Use the surface width and height expanded to powers of 2 */
     w = power_of_two(surface->w);
@@ -306,8 +305,8 @@
     }
 
     /* Save the alpha blending attributes */
-    SDL_GetSurfaceAlphaMod(surface, &saved_alpha);
-    SDL_SetSurfaceAlphaMod(surface, SDL_ALPHA_OPAQUE);
+    SDL_GetSurfaceBlendMode(surface, &saved_mode);
+    SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE);
 
     /* Copy the surface into the GL texture image */
     area.x = 0;
@@ -317,7 +316,7 @@
     SDL_BlitSurface(surface, &area, image, &area);
 
     /* Restore the alpha blending attributes */
-    SDL_SetSurfaceAlphaMod(surface, saved_alpha);
+    SDL_SetSurfaceBlendMode(surface, saved_mode);
 
     /* Create an OpenGL texture for the image */
     glGenTextures(1, &texture);