SFML community forums

Help => Window => Topic started by: meddlingwithfire on November 11, 2012, 11:49:06 pm

Title: RenderWindow not appearing?
Post 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:
Code: [Select]
#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?
Title: Re: RenderWindow not appearing?
Post by: Assassinbeast on November 12, 2012, 01:03:12 am
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()
Title: Re: RenderWindow not appearing?
Post by: eXpl0it3r on November 12, 2012, 01:40:05 am
Quote from: meddlingwithfire
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...
Title: Re: RenderWindow not appearing?
Post by: cire on November 12, 2012, 01:47:53 am
Quote
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.
Title: Re: RenderWindow not appearing?
Post by: The Terminator on November 12, 2012, 02:39:13 pm
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.
Title: Re: RenderWindow not appearing?
Post by: eXpl0it3r on November 12, 2012, 02:57:03 pm
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.
Title: Re: RenderWindow not appearing?
Post by: meddlingwithfire on November 17, 2012, 07:38:48 pm
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.