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

Author Topic: I get some weird error when using View :S  (Read 1168 times)

0 Members and 2 Guests are viewing this topic.

TajiTakeo

  • Newbie
  • *
  • Posts: 12
    • View Profile
I get some weird error when using View :S
« on: March 22, 2013, 11:30:56 pm »
I get the error "error C2065: 'View' : undeclared identifier" and "error C2228: left of '.Move' must have class/struct/union".
But the thing is when i right click view and click "Go to Defenition" it finds "...SFML\Graphics\View.hpp(43)".


file "camera.hpp"
#ifndef CAMERA_H
#define CAMERA_H
#include "sfml.hpp"

class camera
{
        public:

                void view()
                {

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
                                {
                                        View.Move(0, -1);
                                }

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
                                {
                                        View.Move(1, 0);
                                }

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
                                {
                                        View.Move(-1, 0);
                                }

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
                                {
                                        View.Move(0, 1);
                                }
                }

                void zoom()
                {
                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Add))
                                {
                                }

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Dash))
                                {
                                }
                }

}camera;
#endif
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: I get some weird error when using View :S
« Reply #1 on: March 23, 2013, 03:32:27 am »
Reading the documentation might help... ::)

The naming convention changed in SFML 2.0. All functions are now camelCase instead of CamelCase.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything