mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-04 03:15: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;
|
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);
|
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 Texture::GetColorAndAlphaMod() const {
|
||||||
Color color;
|
Color color;
|
||||||
GetColorMod(color.r, color.g, color.b);
|
GetColorMod(color.r, color.g, color.b);
|
||||||
color.a = GetAlphaMod();
|
color.SetAlpha(GetAlphaMod());
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,11 +431,10 @@ public:
|
|||||||
///
|
///
|
||||||
/// \throws SDL2pp::Exception
|
/// \throws SDL2pp::Exception
|
||||||
///
|
///
|
||||||
/// \see http://wiki.libsdl.org/SDL_SetTextureAlphaMod
|
|
||||||
/// \see http://wiki.libsdl.org/SDL_SetTextureColorMod
|
/// \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
|
/// \brief Lock texture for write-only pixel access
|
||||||
@ -560,7 +559,6 @@ public:
|
|||||||
///
|
///
|
||||||
/// \throws SDL2pp::Exception
|
/// \throws SDL2pp::Exception
|
||||||
///
|
///
|
||||||
/// \see http://wiki.libsdl.org/SDL_GetTextureAlphaMod
|
|
||||||
/// \see http://wiki.libsdl.org/SDL_GetTextureColorMod
|
/// \see http://wiki.libsdl.org/SDL_GetTextureColorMod
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user