Hi everyone, I've been messing around with SFML lately and have really come to like the language. However, I am running into roadblocks literally when it comes to drawing large png images or tiles. When I draw my titlescreen images or tilemap, the framerate drags down to 8 or so fps. For example:
px = 0;
py = 0;
for (float qq = 0; qq <= 800; qq +=32)
{
for (float ii = 0; ii <= 608; ii += 32)
{
if (map[px][py] == 0)
{
App.Draw(Tile1);
Tile1.SetPosition(qq,ii);
}
if (map[px][py] == 1)
{
App.Draw(Tile2);
Tile2.SetPosition(qq,ii);
}
py++;
}
px++;
py=0;
}
Is a simple script I wrote to display tiles in a 800x600 window (yes I could have gotten the resolution and changed the array size, but that's not the point). This script running constantly to draw 475 png tiles is really slow.
So my question is, is there a way to draw a sprite or an image only once, so that it does not eat up memory or processing time?
Thanks
-K55