I got SFML to finally work with Qt Creator (I tried using it with Code::Blocks, didn't work) and I ran into a problem, again. Using the "Window" library, I cannot get the window to open. I'll post my code, then describe the problem below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <SFML/Window.hpp>
int main()
{
sf::Window window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
}
return 0;
}
|
Note, this is the same exact code from webpage:
http://www.sfml-dev.org/tutorials/2.1/window-window.php
Now onto my problem.
Using this code, I cannot open the window, as I previously said. No errors come up, either. The console, however, does open. Nothing else happens. It is really strange. Now, one thing I did do, is on the site, I got the TJM version, because that is supposed to work with CB better, and after giving up on that, I just used the same version with Qt Creator. Would that make a difference? I
know that I am linking to the files correctly, because Qt Creator has the drop down menu after the dot separators a menu comes up of all the members of the objects class.
Anyway, just thought I'd try to be as informative as possible. Thanks for any help!
PS: I did post a thread on the SFML forum, but you guys are usually a lot more helpful than what I got from them