Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: RenderWindow not appearing?  (Read 5713 times)

0 Members and 1 Guest are viewing this topic.

meddlingwithfire

  • Newbie
  • *
  • Posts: 4
    • View Profile
RenderWindow not appearing?
« 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:


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?

Assassinbeast

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Email
Re: RenderWindow not appearing?
« Reply #1 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()
« Last Edit: November 12, 2012, 01:06:20 am by Assassinbeast »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11035
    • View Profile
    • development blog
    • Email
Re: RenderWindow not appearing?
« Reply #2 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...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

cire

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Re: RenderWindow not appearing?
« Reply #3 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.

The Terminator

  • Full Member
  • ***
  • Posts: 224
  • Windows and Mac C++ Developer
    • View Profile
Re: RenderWindow not appearing?
« Reply #4 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.
Current Projects:
Technoport

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11035
    • View Profile
    • development blog
    • Email
Re: RenderWindow not appearing?
« Reply #5 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

meddlingwithfire

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: RenderWindow not appearing?
« Reply #6 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.