diff --git a/SDL2pp/Texture.cc b/SDL2pp/Texture.cc index 66d4fb1..8dde4ec 100644 --- a/SDL2pp/Texture.cc +++ b/SDL2pp/Texture.cc @@ -56,6 +56,11 @@ void Texture::SetAlphaMod(Uint8 alpha) { throw Exception("SDL_SetTextureAlphaMod failed"); } +void Texture::SetColorMod(Uint8 r, Uint8 g, Uint8 b) { + if (SDL_SetTextureColorMod(texture_, r, g, b) != 0) + throw Exception("SDL_SetTextureColorMod failed"); +} + void Texture::Swap(Texture& other) noexcept { SDL_Texture* tmp = other.texture_; other.texture_ = texture_; diff --git a/SDL2pp/Texture.hh b/SDL2pp/Texture.hh index 4a2b562..49953c5 100644 --- a/SDL2pp/Texture.hh +++ b/SDL2pp/Texture.hh @@ -51,6 +51,7 @@ public: void SetBlendMode(SDL_BlendMode blendMode); void SetAlphaMod(Uint8 alpha); + void SetColorMod(Uint8 r, Uint8 g, Uint8 b); void Swap(Texture& other) noexcept; };