SFML community forums
Help => General => Topic started 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
-
The video is private.
-
Are you using a game loop like this:
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.