Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML crashes  (Read 1110 times)

0 Members and 3 Guests are viewing this topic.

McMeatMan

  • Newbie
  • *
  • Posts: 2
    • View Profile
SFML crashes
« on: December 08, 2011, 10:11:37 pm »
Hi,
everytime when i put this in the code:
Quote

   if(App.GetInput().IsKeyDown(sf::Key::Down))
   {
      Sprite.Move(0,100 * ElapsedTime); //it just shall go 1 time down
      while(App.GetInput().IsKeyDown(sf::Key::Down)){}
   }   


the program crashes after pressing the down button , i hope you know how to solve the problem ;)

Sorry for my bad english :oops:,   i am german

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
SFML crashes
« Reply #1 on: December 08, 2011, 10:23:29 pm »
SFML doesn't crash. You go into an infinite loop. The input object is only updated when you poll for new events. So the key will stay down, for ever if you do not poll for new events.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio