I feel bad resurrecting an old thread like this, but I wanted to express my opinion.
I agree the whole "power of two" thing might be a little confusing to beginners, but I don't think this is a good reason to prevent those who understand it from using GL_REPEAT.
If you strictly follow this guiding rule, I bet there wouldn't be much left of SFML
Everything is confusing to the beginner. That's why we have docs and forums!
Anyway, I guess it can be changed manually after creating the sf::Image with a few OpenGL calls, but the main reason I use SFML is that I actually don't know OpenGL... (and honestly : I don't want to)
Of course I can read the docs, and I made the change myself in SFML code, but that's not handy.
As Laurent said, repeating the sf::Sprite works too, but it sends N times more vertices to the graphics card (N being the number of time you need to repeat the image), and is rather painful to code :
With GL_REPEAT :
// "image" is a 64x64 texture
sf::Sprite sprite(image);
sprite.SetSubRect(sf::IntRect(0, 0, 256, 64));
window.Draw(sprite);
... without :
// "image" is a 64x64 texture
sf::Sprite sprite(image);
for (int i = 0; i < 4; ++i)
{
sprite.Move(64, 0);
window.Draw(sprite);
}
I don't know for you, but I made my choice.
As I don't use any non-po2 textures, there is no drawback in setting it as the default value, but I understand it might go differently for others.
As Jaenis suggested, I think the best trade-off would be an Image::SetRepeat() function, with GL_CLAMP as a default value.
But that's just my opinion.