I've been working on a secret project lately, and I needed a couple Rectangle Shapes for hidden reasons. I thought I could just use an array of Rectangle Shapes, because I needed to manipulate all of them using the same code, but when initializing their size, color, data, etc. I get an error saying:
A buffer overrun has occurred in SFML.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.The code I am using to initialize them is as follows:
const short bodyCount = 4;
sf::RectangleShape wolfBody[bodyCount];
for (int i = 0; i < bodyCount; i++)
{
wolfBody[i].setSize(sf::Vector2f(32, 32));
wolfBody[i].setFillColor(sf::Color::Red);
wolfBody[i].setOrigin(16, 16);
}
Does anyone know what is wrong with this?