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

Author Topic: Help  (Read 1785 times)

0 Members and 1 Guest are viewing this topic.

Broken

  • Newbie
  • *
  • Posts: 26
    • View Profile
Help
« on: March 14, 2010, 11:17:29 am »
Hi! I haven't made my game yet, but I want ask one thing how to make application just like console in c++.I use Pong code from SFML samples and debug it but when I open application window disappear after few seconds. That problem in c++ console application I solve with command getchar(),but how that solve in SFML.If you didn't understand me here is video.
Sorry on my English.


OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Help
« Reply #1 on: March 20, 2010, 12:38:52 am »
The video is private.
I use the latest build of SFML2

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Help
« Reply #2 on: March 20, 2010, 02:24:16 am »
Are you using a game loop like this:
Code: [Select]
while (App.IsOpened())
{
    sf::Event Event;
    while (App.GetEvent(Event))
    {
        // Window closed
        if (Event.Type == sf::Event::Closed)
            App.Close();

        // Escape key pressed
        if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
            App.Close();
    }
}
?

That is how most people use SFML.