Hmm, I'll do that then. I was going to add a feature to dynamically add loaded images into a texture atlas. It won't hurt having a single extra pixel in it.
Edit:
I moved text rendering to the sprite batcher and saw the fps of a screen with a text-heavy menu skyrocket from 4200 fps to 8300. That's not bad at all! Next is to move windowstyles over, and see what that adds.
Jest:
I have an interesting problem to solve (I haven't yet ran into it, but I presume I will soon enough). When someone creates a surface, then casts that to an image (a surface-created image) should you leave it as it's own texture or do you put that into a texture atlas? There isn't an easy answer.
What if you want to create a lot of surfaces and do a lot of little edits and then cast those to image to do some drawing techniques for a while, then throw that away. If that all gets put into an atlas, would you clear the atlas? Creating dynamic atlases like that isn't easy since texture-packing is not a two-way thing. Conversely if you leave surface-created images outside of texture atlases, then while you'll suffer some performance loss drawing surface-created images, you at least don't run the risk of a lot of unnecessary atlas management that could slow surface generation down.
Or perhaps, better yet, surface-created images don't share an atlas with loaded images. But then having this special kind of atlas would still incur surface generation penalties as you muck with it (by adding and removing). You don't want to bloat up atlases for no real reason.
I might have to benchmark both when the time comes. It's important to find a fast method here since some surface-created images *do* have fundamental uses (besides just being 'middlemen'). Say you have a game where the main character's sprite is paper-dolled. To do this you create a bunch of surfaces, then compile them into one surface in the end. For the surfaces you used to build the one image, you don't need them to persist in an atlas. But the single image you finish with should go into an atlas for fast blitting. Now, of course by calling .createImage() you are intending to keep it for longer, so I guess that's the best hint to say the intended image gets "atlased". But it still can't stop someone from abusing the feature (using many surface-created images).
Edit:
I've been thinking, in SSFML, I could add a new blit method: "WrapBlit" this could come in handy for images that tile... The API would be like:
image.wrapBlit(x, y, u, v)
where x and y is where it goes and u, v, is the texture wrapping part. I made a space game demo in XNA and for the nebula backgrounds I had huge, beautifully tiled images that could wrap easily from the fact the u, v can repeat (it's far, far, far more efficient than drawing 9 images and looping them around). But I can't do this at all with texture atlases. :/
Since, though, it is not a feature Sphere has I might propose this API:
var wrapped_image = new WrappedImage();
wrapped_image.blit(x, y, u, v);
Then it doesn't have to get sent to an atlas and can be ignored if you target vanilla Sphere.
(Also useful for parallax backgrounds)
Edit:
I moved windowstyles over to a partial system. The corners are drawn fast, but the sides and background image are not. They must use un-atlased textures, and cannot be batched since their u,v's must be repeated. The hybrid system only gains another hundred fps, which is good but not the best.
I think there is a way to take the representation of a windowstyle and forgo the u,v approach altogether and generate an actual windowstyle mesh, physically repeating the side images (yes I'm talking about looping and repeating the texture). I just hope this is faster than the current method (which is certainly not bad). I mean, I get to use a full atlas rather than a partial atlas, and vertices are fast to generate.
Edit: (again)
I did the benchmarking and it turns out the hybrid approach is the best on windowstyles. The u,v texturing on sides and bg image give a huge speed boost and accurately clips the images. The vertex mesh is good, but starts failing if there are a lot of images, say, in the background.