Hello! Long time user, first time poster.
I switched to SFML from SDL quite a while ago, and it was a great move up! But there has always been something of SDL's that I really miss sorely, and that's the ability to perform pixel level modifications efficiently.
I'm aware of SetPixel(), but it has more overhead than I'm sure anyone would care for in a function whom will be called more than a million times a second. (500 x 500 image, at 60 frames a second, is 15,000,000, so 'a million' is actually a modest accessment. xD)
What I'm doing right now to circumvent much of that, is this:
sf::Uint8 * p = const_cast<sf::Uint8*> (image->GetPixelsPtr());
// ... mess with the pixels here ...
image->SetPixel(0, 0, image.GetPixel(0, 0));
A const cast, and a backwards function call at the end simply for the sake of setting Image::myTextureUpdate to true. It's not very pretty, even if it works.
Maybe perhaps providing for, say... a public 'Finalize()' function in Image that would set myTextureUpdate to true (and anything else that'd have to be done, in the future), and perhaps another function that returns a non const pointer into the pixel array, that would require Finalize() be called for the image to be valid for rendering?
It could be done with a boolean flag, that'd be set to false in the pointer retrieving function, set to true in Finalize(), and if it's not true, it can set off an Assert or something if someone attempts to render it. I'm sure you'd think of a more elegant way, but that's probably how I'd implement it.
This can't be the first time this has come up, but if it counts at the very least as a vote in the hat, then I'm happy~ Thanks for the awesome library!