I think it's quite easy to add a "DoesCachePixels()/SetCachePixels(bool)" to the image interface, it's trivial (As "IsSmooth()/SetSmooth()")
In the case of not-caching, swap would be the only way to really free (as and only if wanted) that myPixels member after the CreateTexture().
I'm doing a BigImage class, that is multi-texture container similar to sf::Image for images larger than GL's max texture size.
I'm doing it to load three 15 Megabyte (uncompressed) background and making it easy (also implementing a BigSprite derived from sf::Drawable).
Keeping that 45 megs it's not necessary at all.
You're right to say that, but that's just your point of view.
Well, I know... I said it.
But I think you got me wrong (it's probably really hard to keep up reading line by line each post of the forum).
I know that it's useful to keep the pixels in some contexts. But in others it's not, so forcing it to keep them is not a solution neither.
Maybe I want to have 100 static sprites and 40 modifiable ones (for blood splatter for example, applied directly to the image).
It's ok for small (200x100, 80KB) sprites, but for not-so-big backgrounds (1000x1000, 4MB) it's quite a lot of memory waste.
I don't want to sound as a smart-ass, I'm just trying to contribute... so don't take it personal, man.
--------------------------
In
"void Image::SetSmooth(bool Smooth)"
It could check if "myIsSmooth != Smooth" before doing all the bind-change parameter-etc, to know if it's relevant and save some CPU time.
Even if it's not really important as you wont be calling it a lot, it's a good programming habit.
You only need to add an if clause.
---------------------------
void EnsureTextureUpdate() const;
Should be public, as I may want to modify images and batch-update them before the first time they get binded (that could hog the CPU in different moments).