SFML community forums
Help => General => Topic started by: MrUnlucky on November 21, 2011, 11:29:34 pm
-
I've decided to give SFML a try so I started with the tutorials but it looks like I'm stuck right off the bat. I can't seem to create a window.
The code:
#include <SFML/Window.hpp>
int main()
{
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
while(App.IsOpened())
{
sf::Event e;
while(App.GetEvent(e))
{
// Close window
if(e.Type == sf::Event::Closed)
App.Close();
// Escape key pressed
if((e.Type == sf::Event::KeyPressed) && (e.Key.Code == sf::Key::Escape))
App.Close();
}
App.Display();
}
return EXIT_SUCCESS;
}
The command prompt appears, but no window. Any ideas? I'm using VC++ 2010 on Windows 7.
-
Try using a sf::RenderWindow instead of sf::Window. It takes the same parameters.
-
Hmm.. Nope. That doesn't seem to work either.
-
Downloaded VC++ 2008. Same problem.
-
Did you build SFML yourself? What version are you using?
You should try rebuilding SFML or using the SFML binaries (make sure you get the correct type!) if you built it yourself. I'd assume you set everything up correctly as you are not getting errors.
The application works fine on MinGW.
-
Do you have an ATI card?
Unfortunately their is a known bug that prevents windows from showing at all on ATI cards when dynamically linking to SFML 1.6.
The two workarounds are to link to SFML statically, or to upgrade to the current version of SFML2(where the bug has been fixed).
-
Do you have an ATI card?
Unfortunately their is a known bug that prevents windows from showing at all on ATI cards when dynamically linking to SFML 1.6.
The two workarounds are to link to SFML statically, or to upgrade to the current version of SFML2(where the bug has been fixed).
Yes I do have an ATI card so that must be the problem. SFML 2.0 appears to be working properly though so that's good. Thanks to both of you for the help.
-
No problem, glad you fixed it, and welcome to the SFML community!
-
No problem, glad you fixed it, and welcome to the SFML community!
Thanks. :D