Hello.
I've been trying to get started with SFML today. I was planning to use the latest official release (1.6), but for some reason there isn't a Visual Studio 2010 SDK. A lot of people seemed to recommend just using the latest snapshot of 2.0, and since I would have to compile it myself anyway, I decided to go with that.
I downloaded CMake and used that to generate a Visual Studio 2010 (not x64) project for compiling dynamic libraries. I compiled it all, put those compiled files in a folder, and set up my own Visual Studio project to be linked with the release files.
I'm now trying to follow the
"Opening a window" tutorial and the
SFML 2.0 window usage example. Unfortunately, I'm having some problems...
Here is my code:
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
int main() {
sf::Window app(sf::VideoMode(800, 600, 32), "SFML Window");
bool running = true;
while (running) {
app.Display();
}
return EXIT_SUCCESS;
}
When running in debug mode (but with the release SFML files), I get a console window appear, and then after several seconds (which seems like quite a long time), an SFML window appears. The window has a garbled title made up of a few random symbols ("8รต5" for example, but it changes every time), it cannot be focused, cannot be dragged, and cannot be closed. I have to kill the program from Task Manager or stop debugging in my IDE.
When running in release mode, it works exactly the same as above, except the window title is correct instead of being garbled.
So my question is as follows. What's up with the window? What am I doing wrong?
- How can I get rid of the console window? I'm using an empty C++ project in Visual Studio 2010, and I have sfml-main.lib linked in.
Thanks a lot in advance!
Edit 1: Okay, I got rid of the console window. I'm still having trouble with the SFML window, though...
Edit 2: Fixed the garbled window title in debug mode by using the debug SFML files. I'm not quite sure why this is necessary, though. Can anyone explain this to me? Either way, I'm still having trouble with the unresponsive, almost frozen window.