Thanks. Uhm I'm stuck now with rendering tiles on panel.
Well, I think that sprite sheet isn't for me :/ Rendering 1200 32x32 tiles using sfml and texture rectangle gives me about 550-600 fps, and rendering 160 32x32 sprite sheets using the same tileset (AND disabling rendering of normal map), gives me 120-150 fps, so there is a serious performance problem. I don't know, I must find a way to do it with SFML speed on TGUI level. I can easily add tgui::PictureRect, but that will be still performance problem because it can't be used like that: set position -> draw -> set position -> draw -> drawTGUI. So I don't know, I have no idea why sprite sheets work so slow for me.
All I do in my sprite sheets drawing function is:
- I have 256 sprite sheets already loaded (every uses the same tileset) and every of them has a cell already set (sheet0 is tile 0 etc)
- Then, in my drawing function all I do is:
hide all sheets
set positions for visible sheets the same way I set positions for sfml sprites (so it's not performance problem)
call show() for visible sheets
I need hide and show at every call because it is in scrolled panel. But, after removing show and hide calls (so i always render every sheet) fps went up only to 180. So the bottleneck is in other place. Could you look into it, why sprite sheet is so slow?