title: SFML getting window to another class via constructor not working
body: <p>I'm trying to create an object where the SFML RenderWindow object is passed over as a parameter, but it isn't simply working, it complains all the time about pointer and that I'm using them in the wrong way.</p>
  
  <p>Here you have my .h file:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;SFML\System.hpp&gt;
  #include &lt;SFML\Window.hpp&gt;
  #include &lt;SFML\Graphics.hpp&gt;
  
  using namespace sf;
  
  class Shot
  {
  private:
  
      RenderWindow &amp;mainWindow;
  
  public:
  
      Shot(RenderWindow &amp;window);
      void add(float x, float y, float velocity);
  
  };
  </code></pre>
  
  <p>and here my .cpp</p>
  
  <pre><code>#include "Shot.h"
  
  Shot::Shot(RenderWindow &amp;window) : mainWindow(&amp;window)
  {
      mainWindow -&gt; window;
  }
  
  void Shot::add(float x, float y, float velocity)
  {
      CircleShape shape(10);
  
      shape.setPosition(Vector2f(x, y));
  
      shape.setFillColor(Color::Yellow);
  
      mainWindow.draw(shape);
  }
  </code></pre>
  
  <p>Errors:</p>
  
  <pre><code>Error   1   error C2248: 'sf::NonCopyable::operator =' : cannot access private member declared in class 'sf::NonCopyable'
  Error   2   error C2248: 'sf::NonCopyable::operator =' : cannot access private member declared in class 'sf::NonCopyable'
  </code></pre>
  
  <p>i honestly have no clue what's the problem by now an I've probably done it all wrong, but any help would really be appreciated! :)</p>
  
  <p>Best Regards</p>
  
  <p>FreeSirenety</p>