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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Princessjinifer

Pages: [1]
1
Graphics / Re: 'class sf::Window' has no member named 'Member' error
« on: April 08, 2012, 06:30:29 am »
You are probably using a recent SFML2, wich name convention changed to camelCase for member functions.

Display, for example, should now be display, and IsOpened changed to isOpen.

For precise information, read the documentation:
http://www.sfml-dev.org/documentation/2.0/classsf_1_1RenderWindow.php

Read the edit on my original post, I got it all figured out within minutes of posting this. Even though I have been trying to figure it out for the last two days.

2
Graphics / 'class sf::Window' has no member named 'Member' error
« on: April 08, 2012, 06:22:27 am »
With "#include SFML\Window.hpp"
Code: [Select]
'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"
Code: [Select]
'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:

Code: [Select]
#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:

Code: [Select]
#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;
}

Pages: [1]
anything