same bench 200 short separated texts with string "1"
case 1 (push/popGLStates calls removed):
{
text12.setString(str);
text12.setPosition(pos.x, GetHeight() - pos.y);
//window.pushGLStates();
window.draw(text12);
//window.popGLStates();
}
~35fps (blank screen, screwed).
case 2: all uncommented(renders everything correct)
~10fps
case 3: render ok, but without texts
{
//window.pushGLStates();
// window.draw(text12);
//window.popGLStates();
}
~55fps
For my test i could do it only once, but not for my project. I got many layers, each may generate text info. I got thought to push all texts into std::vector, and render it at final stage, but:
1) don't want to do things complicated now
2) not sure how pushing the std::strings will influence on performance.
Of course i understand that my code is not optimized, and some my tricks are really bad. But for now i didn't plane to do optimization, not time yet. And the sfml1.6 allow me to not make my attention on that behaviour.
By the way, i maid short replacement of text render by
http://nehe.gamedev.net/tutorial/freetype_fonts_in_opengl/24001/And it gives me 49-50 fps, compare to SFML2 (10 fps). But i didn't compare the quality, and probably sfml2 overcome it with bigger text(i tested only with short slices of texts).
And i am not sure if this matter, my videocard is not so powerfull (radeon5550).
Cheers, Alex