Flip vertical axis.
This commit is contained in:
parent
0978206a6c
commit
897e4fd271
1 changed files with 2 additions and 1 deletions
|
@ -225,7 +225,8 @@ namespace cloonel {
|
||||||
///--------------------------------------------------------------------------
|
///--------------------------------------------------------------------------
|
||||||
void Texture::Render (int2 parPos, ushort2 parSize) const {
|
void Texture::Render (int2 parPos, ushort2 parSize) const {
|
||||||
assert(IsLoaded());
|
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);
|
SDL_RenderCopy(m_sdlmain->GetRenderer(), m_texture, nullptr, &dest);
|
||||||
}
|
}
|
||||||
} //namespace cloonel
|
} //namespace cloonel
|
||||||
|
|
Loading…
Reference in a new issue