mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 19:05:59 -04:00
Added Color support for Texture
This commit is contained in:
parent
c9684f03d3
commit
2379a402d9
@ -157,7 +157,7 @@ Texture& Texture::SetColorMod(Uint8 r, Uint8 g, Uint8 b) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
Texture& Texture::SetColorAndAlphaMod(const Color& color) {
|
||||
Texture& Texture::SetColorAndAlphaMod(const Color color) {
|
||||
return SetColorMod(color.r, color.g, color.b).SetAlphaMod(color.a);
|
||||
}
|
||||
|
||||
@ -222,7 +222,7 @@ void Texture::GetColorMod(Uint8& r, Uint8& g, Uint8& b) const {
|
||||
Color Texture::GetColorAndAlphaMod() const {
|
||||
Color color;
|
||||
GetColorMod(color.r, color.g, color.b);
|
||||
color.a = GetAlphaMod();
|
||||
color.SetAlpha(GetAlphaMod());
|
||||
return color;
|
||||
}
|
||||
|
||||
|
@ -431,11 +431,10 @@ public:
|
||||
///
|
||||
/// \throws SDL2pp::Exception
|
||||
///
|
||||
/// \see http://wiki.libsdl.org/SDL_SetTextureAlphaMod
|
||||
/// \see http://wiki.libsdl.org/SDL_SetTextureColorMod
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Texture& SetColorAndAlphaMod(const Color& color = Color{255, 255, 255, SDL_ALPHA_OPAQUE});
|
||||
Texture& SetColorAndAlphaMod(const Color color = Color{255, 255, 255, 255});
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Lock texture for write-only pixel access
|
||||
@ -560,7 +559,6 @@ public:
|
||||
///
|
||||
/// \throws SDL2pp::Exception
|
||||
///
|
||||
/// \see http://wiki.libsdl.org/SDL_GetTextureAlphaMod
|
||||
/// \see http://wiki.libsdl.org/SDL_GetTextureColorMod
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user