Hello, I just started with SFML but I have been stuck, trying to get this work for a few days now.
When I try to start the following code, it runs and opens the window, but when I use Esc or the Cross to close it, it gives me some error, wich you can see on the screenshots.
I'm using windows7, Visual C++ Express 2008 and sfml 1.6.
Some help would realy be appriciated!
Greetz,
Hellgast
Here is the code:
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>
#include <iostream>
////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
// Create the main window
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Events");
// Get a reference to the input manager associated to our window, and store it for later use
const sf::Input& Input = App.GetInput();
// Start main loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
// Escape key : exit
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}
// Display window on screen
App.Display();
}
return EXIT_SUCCESS;
}
Here is a screen shot when ran without debugging:
Here are some screenshots when ran with debugging
http://imgur.com/3oWVsIC,9Ai9eHC,wTknSS3,7jPG6YJ#0