title: parameter type mismatch with pointer/reference
body: <p>I´m trying to add a player to a game I´m creating, but during this process I keep getting an error on the window parameter when I´m creating a new player in mainGame.cpp</p>
  
  <p>The issue is a pointer/reference issue, but I can´t figure out how to fix it.</p>
  
  <p>This is the error message:</p>
  
  <blockquote>
    <p>Parameter type mismatch: Incompatible types 'sf::RenderWindow &amp;' and 'sf::RenderWindow *'</p>
  </blockquote>
  
  <p>my mainGame.cpp look like this:</p>
  
  <pre><code>void mainGame::Initialize(sf::RenderWindow* window){
      this-&gt;player = new Player(20,100, config, window);
  }
  
  void mainGame::Destroy(sf::RenderWindow* window){
      delete this-&gt;player;
  }
  </code></pre>
  
  <p>my mainGame.h file:</p>
  
  <pre><code>class mainGame : public tiny_state{
  public:
      void Initialize(sf::RenderWindow* window);
      void Destroy(sf::RenderWindow* window);
  
  protected:
      Player&amp; player;
      Config config;
      sf::RenderWindow window;
  };
  </code></pre>
  
  <p>my Plyer.cpp file:</p>
  
  <pre><code>Player::Player(float x, float y, const Config&amp; config, sf::RenderWindow&amp; )
      : x(x), y(y),
      config(config),
      window(window)
  {
      rectangle.setSize(sf::Vector2f(sizeWidth, sizeHeight));
      rectangle.setFillColor(sf::Color::White);
  }
  
  void Player::move(float delta){
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
          y -= speed * delta;
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
          y += speed * delta;
  
      y = std::max(y, 0.f);
      y = std::min(y, (float)(config.screenheight - sizeHeight));
  }
  
  void Player::draw(){
      rectangle.setPosition(x, y);
      window.draw(rectangle);
  }
  </code></pre>
  
  <p>my player.h file:</p>
  
  <pre><code>struct Player{
      Player(float x, float y, const Config&amp; config, sf::RenderWindow&amp; window);
  
      void move(float delta);
      void draw();
  
      const int sizeHeight = 100;
      const int sizeWidth = 10;
      const float speed = 5;
      float x, y;
  
      sf::RectangleShape rectangle;
      const Config&amp; config;
      sf::RenderWindow&amp; window;
  };
  </code></pre>