1
Graphics / Is there a bitblt like function for SFML
« on: January 05, 2011, 06:20:17 am »
I changed from the copy to using sprites
So my draw code is like this
Then when I draw
bbImage is the RenderImage
So my draw code is like this
Code: [Select]
for (; x < ex; x++)
{
tile = MainLayer[y][x] & 0xFF;
if (tile)
{
//MessageBox(0, "non-zero tile!", "blah", 0);
r1.Left = (tile & 15) * TileSize;
r1.Top = (tile / 16) * TileSize;
r2.Left = sx;
r2.Top = sy;
if(sx>0&&sy>0){
tmpSpr.SetImage(tileset);
tmpSpr.SetSubRect(r1);
tmpSpr.SetPosition(sx,sy);
bbImage.Draw(tmpSpr);
}
}
sx += TileSize;
}
sy += TileSize;
}
Then when I draw
Code: [Select]
bbImage.Display();
sf::Sprite bbS(bbImage.GetImage());
App.Draw(bbS);
App.Display();
bbImage is the RenderImage