hey
my concept / direction of product already stands. Next step for me is to find the right way to get most performance out of SFML - to assure that i will find my swarms of minions walk, act and fight smoothly, even when there are 100s of them _visible_. Bethink of all the AI calculations behind them - i simply can't afford wasting CPU time for unnecessary draw calls.
so ...
i looked through the AltSpriteHolder class - not bad - found that it must be faster than the original. However, in the end it still hikes through the RenderTarget::draw for _every_ single Texture displayed - not really what i am looking for.
Looking through the original sf::Sprite source, i ended up going through RenderTarget::draw. Seeing how it works and how Texture::bind works almost gives me the answer that it _is_ advantageous to have the GPU find all textures gathered in one big texture. The SFML sources actually telling me that. But is it really that way?
So i went looking for a place where Textures are changed fast and efficient - and got stuck in Texture:bind() - what's the point about m_pixelsFlipped ? Is it a graphics-card thing that it flips pixels vertically so we are forced to check this flag at _every_ Texture::bind call, which is called in every RenderTarget::draw call? Otherwise this could be done earlier in the loadFrom* functions.
Same with the GLfloat matrix - it could be precalculated outside of Texture::bind and only changed when m_actualSize changes. The whole check for (coordinateType == Pixels) could probably be moved outside bind().
However - Texture::bind should only be used in precalculation/pre-render phase. Pre-render as much as possible !
oh, in the Texture::bind - Texture.cpp Line 487 - i found this
if (texture && texture->m_texture)
when texture is NULL this will crash anyway. Would change it to
if(texture) if(texture->m_texture)
or even better just go
if(texture->m_texture)
maybe i'll find more later. Possible conclusion: Better answer my questions to stop me looking through your code
NO! I don't want to consider rewriting RenderTarget::draw() - that goes too far - i would like to skip caring about openGL issues and just enjoy SFML.
Or should i
?
i think i will now write my own TileMap class for big Textures full of small ones and see how fast it can become. Or are any suggestions left for me out there ?
regards
Breakfaster