sorry for late respond :/
i figured out the code that made it slow
it goes something like this
sf::RectangleShape Grect;
sf::RectangleShape Brect;
Brect.setSize(sf::Vector2f(50,50));
Brect.setFillColor(sf::Color::Color(0,0,150));
Grect.setSize(sf::Vector2f(50,50));
Grect.setFillColor(sf::Color::Color(0,200,0));
void drawrect()
{
for(int i=0; i<900; i++)
{
Brect.setPosition(x(i),y(i));
Grect.setPosition(x(i),y(i));
window.draw(Brect);
window.draw(Grect);
}
}
so basically it just draws the same square multiple times at different positions
its kinda weird that it only slows it down initially given that i am always running this code
but any way is there any better way of doing this ?