With "#include SFML\Window.hpp"
'class sf::Window' has no member named 'IsOpened'
'class sf::Window' has no member named 'PollEvent'
'class sf::Window' has no member named 'Close'
'class sf::Window' has no member named 'Display'
With "#include SFML\Graphics.hpp"
'class sf::RenderWindow' has no member named 'IsOpened'
'class sf::RenderWindow' has no member named 'PollEvent'
'class sf::RenderWindow' has no member named 'Close'
'class sf::RenderWindow' has no member named 'Display'
The errors above are the 4 errors I get when trying to compile my program.. I have been talking with someone who knows about SFML and I have him stumped too. Does anyone here have any ideas for fixes?
This is the source code:
#include <iostream>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main() {
sf::Window FollowCursor(sf::VideoMode(800, 600, 32), "Follow Cursor - SFML Window");
while (FollowCursor.IsOpened()) {
sf::Event FCEvent;
while (FollowCursor.PollEvent(FCEvent)) {
if (FCEvent.Type == sf::Event::Closed) {
FollowCursor.Close();
}
}
FollowCursor.Display();
}
return EXIT_SUCCESS;
}
Thanks in advance!
-Princessjinifer
EDIT: I fixed them... Nevermind. I looked at
http://www.sfml-dev.org/documentation/2.0/ and it showed that IsOpened is actually isOpen, and PollEvent is pollEvent.. so on and so forth.. So, here is the corrected code:
#include <iostream>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main() {
sf::Window FollowCursor(sf::VideoMode(800, 600, 32), "Follow Cursor - SFML Window");
while (FollowCursor.isOpen()) {
sf::Event FCEvent;
while (FollowCursor.pollEvent(FCEvent)) {
if (FCEvent.type == sf::Event::Closed) {
FollowCursor.close();
}
}
FollowCursor.display();
}
return EXIT_SUCCESS;
}