From 897e4fd271673afb52936d5dbef3a19401b1655d Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Sat, 22 Feb 2014 17:07:02 +0100 Subject: [PATCH] Flip vertical axis. --- src/texture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/texture.cpp b/src/texture.cpp index 442e486..3a4d376 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -225,7 +225,8 @@ namespace cloonel { ///-------------------------------------------------------------------------- void Texture::Render (int2 parPos, ushort2 parSize) const { assert(IsLoaded()); - const SDL_Rect dest = { parPos.x(), parPos.y(), parSize.x(), parSize.y() }; + const int screenHeight = m_sdlmain->DefWidthHeight().y(); + const SDL_Rect dest = { parPos.x(), screenHeight - parPos.y() - parSize.y(), parSize.x(), parSize.y() }; SDL_RenderCopy(m_sdlmain->GetRenderer(), m_texture, nullptr, &dest); } } //namespace cloonel