SFML community forums
Help => Graphics => Topic started by: sfmlhelperguy on January 16, 2012, 06:22:44 pm
-
#include<SFML/Graphics.hpp>
int main()
{
sf::VideoMode Vmode(640,480,32);
sf::RenderWindow Window(Vmode,"Hello There");
sf::Text text("Something");
while(Window.IsOpened())
{
sf::Event Event;
while(Window.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed || Event.Key.Code == sf::Key::Escape)
{
Window.Close();
}
}
Window.Clear();
Window.Draw(text);
Window.Display();
}
return 0;
}
And here are the errors:
In function 'int main()':
line 6 error: 'Text' is not a member of 'sf'
line 6 error: expected ';' before 'text'
line 18 error: 'text' was not declared in this scope
I dont know what the problem is please help me
-
Are you sure that you have SFML 2.0 headers?
-
Are you sure that you have SFML 2.0 headers?
Idk that's why im asking do I need another header or something because I have every dll I need in my program folder
-
Idk
Which version of SFML are you using? You must know that ;)
-
Idk
Which version of SFML are you using? You must know that ;)
version 1.6 from what I see
-
The code in your first message is 2.0. You probably read the wrong documentation or tutorials.
-
The code in your first message is 2.0. You probably read the wrong documentation or tutorials.
Oh really wow so then how do you make text in sfml 2.0?
-
Take a look at the example at the link below. It has a perfect example.
http://sfml-dev.org/documentation/2.0/
-
The code in your first message is 2.0. You probably read the wrong documentation or tutorials.
Oh really wow so then how do you make text in sfml 2.0?
Your code is already designed for SFML2. If you want to know how to make text in SFML 1.6, that is the one you are using, check the 1.6 tutorials on SFML site.
-
And if you want to know how to realize it in SFML 2, you should first get SFML 2 ;)
Download it on the GitHub page. There's an installation tutorial that shows you how to build the library with CMake.