mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-08 06:48:56 -04:00
Implement Renderer Output size getters
This commit is contained in:
parent
b6781c3d93
commit
e5c74863f0
@ -285,4 +285,25 @@ void Renderer::GetDrawColor(Uint8& r, Uint8& g, Uint8& b, Uint8& a) const {
|
||||
throw Exception("SDL_GetRenderDrawColor failed");
|
||||
}
|
||||
|
||||
Point Renderer::GetOutputSize() const {
|
||||
int w, h;
|
||||
if (SDL_GetRendererOutputSize(renderer_, &w, &h) != 0)
|
||||
throw Exception("SDL_GetRendererOutputSize failed");
|
||||
return Point(w, h);
|
||||
}
|
||||
|
||||
int Renderer::GetOutputWidth() const {
|
||||
int w;
|
||||
if (SDL_GetRendererOutputSize(renderer_, &w, nullptr) != 0)
|
||||
throw Exception("SDL_GetRendererOutputSize failed");
|
||||
return w;
|
||||
}
|
||||
|
||||
int Renderer::GetOutputHeight() const {
|
||||
int h;
|
||||
if (SDL_GetRendererOutputSize(renderer_, nullptr, &h) != 0)
|
||||
throw Exception("SDL_GetRendererOutputSize failed");
|
||||
return h;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -659,6 +659,42 @@ public:
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void GetDrawColor(Uint8& r, Uint8& g, Uint8& b, Uint8& a) const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the output size of a rendering context
|
||||
///
|
||||
/// \returns Point representing output size
|
||||
///
|
||||
/// \throws SDL2pp::Exception
|
||||
///
|
||||
/// \see http://wiki.libsdl.org/SDL_GetRendererOutputSize
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Point GetOutputSize() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the output width of a rendering context
|
||||
///
|
||||
/// \returns Output width
|
||||
///
|
||||
/// \throws SDL2pp::Exception
|
||||
///
|
||||
/// \see http://wiki.libsdl.org/SDL_RenderGetClipRect
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int GetOutputWidth() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the output height of a rendering context
|
||||
///
|
||||
/// \returns Output height
|
||||
///
|
||||
/// \throws SDL2pp::Exception
|
||||
///
|
||||
/// \see http://wiki.libsdl.org/SDL_RenderGetClipRect
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int GetOutputHeight() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user