Advertisement
Guest User

Untitled

a guest
May 17th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. class Game
  2. {
  3. public:
  4.     Game();
  5.     void run();
  6. private:
  7.     void processEvents();
  8.     void update();
  9.     void render();
  10.     sf::RenderWindow window; // instantiated object from class RenderWindow
  11. };
  12.  
  13. void Player::drawPlayer()
  14.     {
  15.         window.draw(playerImage); // window is undeclared from class game in another header file
  16.     }
  17.  
  18. /* Steps reproduced
  19.  *  made sf::RenderWindow window inside a void friend function, didnt work
  20.  *  made sf::RenderWindow window a aurgment of a function, did not work.
  21.  * ERROR MESSAGE:
  22.  * Error    use of undeclared identifier 'window'   25:9
  23.  *Error ‘window’ was not declared in this scope 25:9
  24.  *Error ‘window’ was not declared in this scope
  25. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement