mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-09 15:28:29 -04:00
Implement some Renderer getters
This commit is contained in:
parent
a22e667dbc
commit
b6781c3d93
@ -273,4 +273,16 @@ Rect Renderer::GetViewport() const {
|
|||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_BlendMode Renderer::GetDrawBlendMode() const {
|
||||||
|
SDL_BlendMode mode;
|
||||||
|
if (SDL_GetRenderDrawBlendMode(renderer_, &mode) != 0)
|
||||||
|
throw Exception("SDL_GetRenderDrawBlendMode failed");
|
||||||
|
return mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Renderer::GetDrawColor(Uint8& r, Uint8& g, Uint8& b, Uint8& a) const {
|
||||||
|
if (SDL_GetRenderDrawColor(renderer_, &r, &g, &b, &a) != 0)
|
||||||
|
throw Exception("SDL_GetRenderDrawColor failed");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -632,6 +632,33 @@ public:
|
|||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Rect GetViewport() const;
|
Rect GetViewport() const;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the blend mode used for drawing operations
|
||||||
|
///
|
||||||
|
/// \return Current SDL_BlendMode
|
||||||
|
///
|
||||||
|
/// \throws SDL2pp::Exception
|
||||||
|
///
|
||||||
|
/// \see http://wiki.libsdl.org/SDL_GetRenderDrawBlendMode
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
SDL_BlendMode GetDrawBlendMode() const;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the additional color value multiplied into render copy operations
|
||||||
|
///
|
||||||
|
/// \param[out] r Variable to be filled in with red value used to draw on the rendering target
|
||||||
|
/// \param[out] g Variable to be filled in with green value used to draw on the rendering target
|
||||||
|
/// \param[out] b Variable to be filled in with blue value used to draw on the rendering target
|
||||||
|
/// \param[out] a Variable to be filled in with alpha value used to draw on the rendering target
|
||||||
|
///
|
||||||
|
/// \throws SDL2pp::Exception
|
||||||
|
///
|
||||||
|
/// \see http://wiki.libsdl.org/SDL_GetRenderDrawColor
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
void GetDrawColor(Uint8& r, Uint8& g, Uint8& b, Uint8& a) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user