SFML community forums
Help => Graphics => Topic started by: Futochu on March 18, 2015, 05:50:47 am
-
Hey all, I've recently been working on a map generator as an experiment with VertexArrays. Originally I had been working with sprites, but at higher zoom levels I found that the rendering process was so resource intensive there was no way I could implement anything else.
As a result, I switched to VertexArray drawing which initially seemed to work quite well. However, if I am to zoom in the rendering seems even slower than before (!?). Unless I'm doing something wrong, this seems completely counter-intuitive to me. Could someone point me in the right direction?
The code in question (The RenderArray work is in this branch). (https://github.com/Futochu/Townhou/tree/Switch-from-sprite-to-VertexArray)
The offending code is probably in Tilemap.cpp
Thanks.
EDIT: This was due to textures being loaded every draw cycle. Higher zoom = larger images. Who knew texture loading was so resource hungry?
-
Use a profiler and find out what's the problem.
-
Did not know these existed! Thanks.
EDIT: Super easy to use to solve this issue.