SFML community forums

Help => General => Topic started by: Broken on March 14, 2010, 11:17:29 am

Title: Help
Post by: Broken 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.

http://www.youtube.com/watch?v=AzloDqPuYuU
Title: Help
Post by: OniLinkPlus on March 20, 2010, 12:38:52 am
The video is private.
Title: Help
Post by: model76 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.