Skip to content

Commit

Permalink
Remove set_blend_mode from ttexture.
Browse files Browse the repository at this point in the history
I can't think of any use case when we would use anything else than
SDL_BLENDMODE_BLEND. If anyone can, they can re-add it.
  • Loading branch information
lipk committed Jun 17, 2014
1 parent 616ab5f commit f698dda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
14 changes: 2 additions & 12 deletions src/sdl/texture.cpp
Expand Up @@ -46,6 +46,7 @@ ttexture::ttexture(SDL_Renderer& renderer,
, alpha_(0)
, source_surface_(NULL)
{
SDL_SetTextureBlendMode(texture_, SDL_BLENDMODE_BLEND);
if(!texture_) {
throw texception("Failed to create a SDL_Texture object.", true);
}
Expand Down Expand Up @@ -336,18 +337,6 @@ Uint8 ttexture::alpha() const
return alpha_;
}

void ttexture::set_blend_mode(SDL_BlendMode mode)
{
SDL_SetTextureBlendMode(texture_, mode);
}

SDL_BlendMode ttexture::blend_mode() const
{
SDL_BlendMode res;
SDL_GetTextureBlendMode(texture_, &res);
return res;
}

void ttexture::set_color_mod(Uint8 r, Uint8 g, Uint8 b)
{
mod_r_ = r;
Expand Down Expand Up @@ -431,6 +420,7 @@ void ttexture::initialise_from_surface(SDL_Renderer& renderer, const int access)
} else {
throw texception("Unknown texture access mode.", false);
}
SDL_SetTextureBlendMode(texture_, SDL_BLENDMODE_BLEND);
}

} // namespace sdl
Expand Down
12 changes: 0 additions & 12 deletions src/sdl/texture.hpp
Expand Up @@ -259,18 +259,6 @@ class ttexture
*/
Uint8 alpha() const;

/**
* Sets the blend mode of the texture.
*
* @param mode One of the values enumerated in SDL_BlendMode.
*/
void set_blend_mode(SDL_BlendMode mode);

/**
* Returns the blend mode of the texture.
*/
SDL_BlendMode blend_mode() const;

/**
* Sets the color modulation of the texture.
*
Expand Down

0 comments on commit f698dda

Please sign in to comment.