Hi.
After running a program, I get freeze thing (Aplication stops to response) and I have to terminate it by system manager. In CodeBlocks it says
Process returned -805306369 (0xCFFFFFFF)
case Game::Playing:
{
while(gameState!=ShowingMenu)
{
mainWindow.clear(sf::Color(80,70,200));
player1.Draw(mainWindow);
mainWindow.display();
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
{
ShowMenu();
gameState = ShowingMenu;
cout << 1;
}
else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
{
player1.mirror(false);
mainWindow.clear(sf::Color(80,70,200));
player1.moving(-2,0);
player1.Draw(mainWindow);
mainWindow.display();
cout << 2;
}
else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
{
player1.mirror(true);
mainWindow.clear(sf::Color(80,70,200));
player1.moving(2,0);
player1.Draw(mainWindow);
mainWindow.display();
cout << 3;
}
}
if(currentEvent.type == sf::Event::Closed)
gameState=Game::Exiting;
}
it works fine in about 5-10 seconds, and after it hangs (freezes). What can couse such behaviour?
Thanks Mike.