Add method to set color component multipliers

This commit is contained in:
Dmitry Marakasov 2013-12-18 05:51:44 +04:00
parent 7698a2522e
commit 96576e112d
2 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,11 @@ void Texture::SetAlphaMod(Uint8 alpha) {
throw Exception("SDL_SetTextureAlphaMod failed"); 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 { void Texture::Swap(Texture& other) noexcept {
SDL_Texture* tmp = other.texture_; SDL_Texture* tmp = other.texture_;
other.texture_ = texture_; other.texture_ = texture_;

View File

@ -51,6 +51,7 @@ public:
void SetBlendMode(SDL_BlendMode blendMode); void SetBlendMode(SDL_BlendMode blendMode);
void SetAlphaMod(Uint8 alpha); void SetAlphaMod(Uint8 alpha);
void SetColorMod(Uint8 r, Uint8 g, Uint8 b);
void Swap(Texture& other) noexcept; void Swap(Texture& other) noexcept;
}; };