SFML community forums
Help => Window => Topic started by: meddlingwithfire on November 11, 2012, 11:49:06 pm
-
I am attempting to follow a video tutorial, and I've run into an strange runtime issue.
I have my project set up, I and am able to compile and run. But I am not able to see the RenderWindow on my screen. All I can see is an empty console window pop up. No compile errors and no linker errors are mentioned in the build log. What am I missing?
I am trying to follow along at 6:14 location in the tutorial below:
http://www.youtube.com/watch?v=LbWavdiod1Q
In the video at 6:14, you can see he has two windows open: the black console window, and another blue-ish window (which I assume is the RenderWindow). When I build and run, I see the black console window, but the blue window never appears.
Environment:
Windows 7 Professional 64-bit
Code::Blocks + MinGW
SFML 1.6, dynamically linked
I do have an ATI video card - I've heard that ATI doesn't play well with SFML, but I haven't seen any specific references to my issue in regards to ATI.
Here's the code I am trying to run:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600, 32), "SFML Sample Application");
while(window.IsOpened())
{
sf::Event event;
while(window.GetEvent(event))
{
switch(event.Type)
{
case sf::Event::Closed:
window.Close();
break;
}
}
window.Clear();
window.Display();
}
return 0;
}
Any ideas?
-
i think you forgot to link the dll files under linker > input > additional Dependecies.
just include this: (for 2.0., but maybe 1.6 is the same)
sfml-main-d.lib
sfml-system-d.lib
sfml-window-d.lib
sfml-graphics-d.lib
sfml-network-d.lib
sfml-audio-d.lib
Im using sfml 2.0 and in 2.0, window.isopened() is wrong
its window.isopen()
-
SFML 1.6, dynamically linked
I do have an ATI video card - I've heard that ATI doesn't play well with SFML, but I haven't seen any specific references to my issue in regards to ATI.
Just use SFML 2 instead of 1.6...
SFML 1.6 is over 2 years unmaintained, thus outdated has the ugly ATI bug that you just encountered (window doesn't open) and lacks a lot of nice features that SFML 2 brings. ;)
If you don't want/can't then you need to link statically...
-
but I haven't seen any specific references to my issue in regards to ATI.
http://en.sfml-dev.org/forums/index.php?topic=9127.0
http://en.sfml-dev.org/forums/index.php?topic=7288.0
http://en.sfml-dev.org/forums/index.php?topic=9145.0
Definitely nothing about that on these forums.
-
SFML 2.0 is much better than 1.6. Also, be sure to select a GUI application under the properties instead of a console application.
-
Also, be sure to select a GUI application under the properties instead of a console application.
For debugging I wouldn't recommend that, because then you don't have a clue when SFML prints something out, like when a file can't be loaded, and you'd lose the ability to quickly return some debugging values to see what's actually going on.
For releases one should link against sfml-main and change the subsystem to window instead of console.
-
Thanks for the hints, guys! I've switched to using the SFML 2.0 RC build, and that's solved my problem. Now I can get down to the fun stuff.
@cire -- Sorry, I definitely missed those. I'll spend more time searching next round.