Hello
I've just started experimenting with SFML today, and I stumbled across a problem I can't seem to fix.
When trying out the example code of the "Opening a window" tutorial, the window won't open at all. Everything compiles without any problems, but when I open the executable nothing happens. There's no window popping up, the program just idles.
At first I thought it was because I was using a Win32 Console application project. The console window would just sit there idling, but when I switched to a Windows project, the window would still not pop up and the program would just idle in the background.
I'm using VS2010. I've set up the include and lib directories and linked the library files (sfml-window.lib, sfml-graphics.lib, sfml-system.lib) as described in the VS tutorial. I also placed the corresponding .dll files in my executable folder.
Here's the part I really can't seem to figure out:
When I use the example solution included in the SDK (SFML.sln) and paste my code in one of the projects, it compiles and runs just fine. The window pops up just like it's supposed to.
I've read through the tutorial a dozen of times trying to find what I missed but I can't seem to find it. I also can't find what distinguishes the example solution from my own.
Seeing as the code works in the example solution but not in my own solution, it's probably something in the settings of the project/solution. Anyone who knows what I'm missing? Thanks in advance.
For reference, here's the code
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Window");
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
if ((Event.Type == sf::Event::Closed) ||
((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape)))
{
App.Close();
break;
}
}
App.Clear();
App.Display();
}
return EXIT_SUCCESS;
}