From 96576e112d2cd72feecbfe793a2e3b6a9780ddfe Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Wed, 18 Dec 2013 05:51:44 +0400 Subject: [PATCH] Add method to set color component multipliers --- SDL2pp/Texture.cc | 5 +++++ SDL2pp/Texture.hh | 1 + 2 files changed, 6 insertions(+) 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; };