SFML community forums

Help => Graphics => Topic started by: Krofna on December 29, 2011, 01:33:31 pm

Title: Why does sf::RenderTexture rotate texture?
Post 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:

Code: [Select]
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?
Title: Why does sf::RenderTexture rotate texture?
Post by: Laurent on December 29, 2011, 01:34:42 pm
Maybe you forgot to call Display() on your RenderMapTexture after drawing.
Title: Why does sf::RenderTexture rotate texture?
Post by: Krofna on December 29, 2011, 01:45:15 pm
Ah yes, that seem to fix it. Thanks.