SFML community forums

Help => Window => Topic started by: BananaDarras on February 14, 2013, 03:39:27 pm

Title: sf::window does not contain a "draw()" function; cannot draw sprites. SFML 2.0
Post by: BananaDarras on February 14, 2013, 03:39:27 pm
Hi all! I was wondered how to draw sprites with SFML 2.0, as the window class does not contain a draw function like 1.6, and many tutorials for 2.0 say it does. Thanks.
Title: Re: sf::window does not contain a "draw()" function; cannot draw sprites. SFML 2.0
Post by: Laurent on February 14, 2013, 03:45:07 pm
As in SFML 1.6, you must use a sf::RenderWindow, not a sf::Window.
Title: Re: sf::window does not contain a "draw()" function; cannot draw sprites. SFML 2.0
Post by: eXpl0it3r on February 14, 2013, 03:45:43 pm
as the window class does not contain a draw function like 1.6
And how would you've deduced this? Did you're "intelligent" part of your IDE "tell" you this?
Take a look at the example in the documentation (http://www.sfml-dev.org/documentation/2.0/), make sure your environment is setup correctly and never trust "intelligent" code look up things, but only trust your compiler.
Title: Re: sf::window does not contain a "draw()" function; cannot draw sprites. SFML 2.0
Post by: BananaDarras on February 14, 2013, 05:01:36 pm
Quote
As in SFML 1.6, you must use a sf::RenderWindow, not a sf::Window.

Thanks, I didn't know that you had to use sf::RenderWindow.

Quote
And how would you've deduced this? Did you're "intelligent" part of your IDE "tell" you this?

I am using VS2010 and it said the window.draw() didn't exist even when I tried to compile it, it ends up I had to use sf::RenderWindow instead of sf::Window. I didn't realize that  :-\

Thanks for the help.
Title: Re: sf::window does not contain a "draw()" function; cannot draw sprites. SFML 2.0
Post by: eXpl0it3r on February 14, 2013, 06:46:47 pm
I am using VS2010 and it said the window.draw() didn't exist even when I tried to compile it, it ends up I had to use sf::RenderWindow instead of sf::Window. I didn't realize that  :-\
Hasn't been different in SFML 1.6 and all the examples you can find use a sf::RenderWindow. ;)