SFML community forums

General => General discussions => Topic started by: Mars_999 on April 03, 2011, 03:49:58 am

Title: How to flip image for OpenGL texture?
Post by: Mars_999 on April 03, 2011, 03:49:58 am
Ok I have tried to use sf::Sprite and sf::Image to do this, but I am guessing I am going to have to do it myself?

sf::Image image;
sf::Sprite texture;

texture.FlipY(true);
texture.SetImage(image);

image = *texture.GetImage();

the texture isn't flipped....

Thanks!

BTW will this have a built in ability in 1.6 ever? or 2.0?
Title: How to flip image for OpenGL texture?
Post by: Groogy on April 03, 2011, 03:57:24 am
A sprite defines how to render the image for this instance. So by telling the sprite we are going to flip it doesn't flip the actual image. But when you tell the sprite to be rendered it will render the image flipped.

From a sprite's perspective the image is constant, read-only and is not allowed to change it.