SFML community forums
Help => Graphics => Topic started by: Krofna on December 29, 2011, 01:33:31 pm
-
For some weird reason, when I load tile map into sf::RenderTexture, and then display it like this:
void Map::ShowMap()
{
sf::Sprite sprite(RenderMapTexture.GetTexture());//RenderMapTexture is object of sf::RenderTexture
MapWindow->Draw(sprite);//MapWindow is object of sf::RenderWindow
//Display is called in game loop right after calling Map::ShowMap();
}
Texture showed gets rotated for 180 degrees. I tried rotating sprite to counter that, but then screen goes black.
This is how it looks like:
http://img854.imageshack.us/img854/6717/rotirano.png
One thing is sure tho; my tiles arent rotated :D
Any idea why this happens?
-
Maybe you forgot to call Display() on your RenderMapTexture after drawing.
-
Ah yes, that seem to fix it. Thanks.