Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
We don't want to save the alpha modulation, we want to save the blend…
Browse files Browse the repository at this point in the history
… mode.
  • Loading branch information
slouken committed Jun 27, 2013
1 parent b8f1e4d commit 64205b6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/testshader.c
Expand Up @@ -281,8 +281,7 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord)
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);
Expand All @@ -306,8 +305,8 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord)
}

/* 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;
Expand All @@ -317,7 +316,7 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord)
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);
Expand Down

0 comments on commit 64205b6

Please sign in to comment.