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 73240b4494cd6412
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
     1.1 --- a/test/testshader.c	Thu Jun 27 11:44:07 2013 -0700
     1.2 +++ b/test/testshader.c	Thu Jun 27 11:49:19 2013 -0700
     1.3 @@ -281,8 +281,7 @@
     1.4      int w, h;
     1.5      SDL_Surface *image;
     1.6      SDL_Rect area;
     1.7 -    Uint32 saved_flags;
     1.8 -    Uint8 saved_alpha;
     1.9 +    SDL_BlendMode saved_mode;
    1.10  
    1.11      /* Use the surface width and height expanded to powers of 2 */
    1.12      w = power_of_two(surface->w);
    1.13 @@ -306,8 +305,8 @@
    1.14      }
    1.15  
    1.16      /* Save the alpha blending attributes */
    1.17 -    SDL_GetSurfaceAlphaMod(surface, &saved_alpha);
    1.18 -    SDL_SetSurfaceAlphaMod(surface, SDL_ALPHA_OPAQUE);
    1.19 +    SDL_GetSurfaceBlendMode(surface, &saved_mode);
    1.20 +    SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE);
    1.21  
    1.22      /* Copy the surface into the GL texture image */
    1.23      area.x = 0;
    1.24 @@ -317,7 +316,7 @@
    1.25      SDL_BlitSurface(surface, &area, image, &area);
    1.26  
    1.27      /* Restore the alpha blending attributes */
    1.28 -    SDL_SetSurfaceAlphaMod(surface, saved_alpha);
    1.29 +    SDL_SetSurfaceBlendMode(surface, saved_mode);
    1.30  
    1.31      /* Create an OpenGL texture for the image */
    1.32      glGenTextures(1, &texture);