0
\$\begingroup\$

In their official tutorials it is said that to draw graphics on screen, i have to use RenderWindow instead of Window. But when i write sf:: RenderWindow window, error pops up saying that there is no RenderWindow in sf:: . I copy-pasted the code but it still does not works. What could possibly be the reason behind this ?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ #include <SFML/Graphics.hpp> ? \$\endgroup\$
    – Alayric
    May 1 '15 at 23:21
  • \$\begingroup\$ @Alayric yes. I was using #include <SFML/Window.hpp> instead of #include <SFML/Graphics.hpp>, and that was causing the problem. \$\endgroup\$
    – arandomguy
    May 3 '15 at 20:38
1
\$\begingroup\$

sf::Window is part of the SFML Window module but sf::RenderWindow is part of the SFML Graphics module. Hence you have to include SFML/Graphics.hpp in order to use it.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .