title: Sprite not showing sfml
body: <p>I want to display my player in the window but my player sprite is not showing in the window. I am new to c++. I want to learn classes, inheritence, composition, etc in this way.I have 3 files Player.cpp, Game.cpp and main.cpp. I am using main.cpp to call Game.cpp using a fuction called Run().</p>
  <p>Got nothing to try.</p>
  <p><em><strong>Player.cpp</strong></em></p>
  <pre><code>#include &quot;Player.hpp&quot;
  #include &quot;string.h&quot;
  #include &lt;iostream&gt;
  
  
  void Player::initPlayer()
  {
      const char* playerTexturePath = &quot;/Users/don/Desktop/sfmlgames/game1/img/MCmid.png&quot;;
      if(!mPlayerTexture.loadFromFile(playerTexturePath))
      {
          std::cout &lt;&lt; &quot;mPlayerTexturePath not found!!&quot; &lt;&lt; std::endl;
      }
      mPlayerSprite.setTexture(mPlayerTexture);
      mPlayerSprite.setPosition(100.f, 100.f);
      mPlayerSprite.setScale(1.f, 1.f);
  }
  
  void Player::draw_player(sf::RenderWindow &amp;win)
  {
      win.draw(mPlayerSprite);
  }
  </code></pre>
  <p><em><strong>Game.cpp</strong></em></p>
  <pre><code>#include &quot;Game.hpp&quot;
  #include &lt;iostream&gt;
  
  Player player1;
  
  //Constructor: Create a window and Player
  Game::Game() : mWindow(sf::VideoMode(640, 480), &quot;Game&quot;)
  {
      //Frame rate 60
      mWindow.setFramerateLimit(60);  
      player1.initPlayer();
      }
  
  //Game loop
  void Game::Run()
  {
  
      while(mWindow.isOpen())
      {
          
          render();
          events();
          update();
          
      }
  }
  
  
  
  void Game::events()
  {
      sf::Event event;
      
      while (mWindow.pollEvent(event))
      {
          if (event.type == sf::Event::Closed)
          {
              mWindow.close();
          }
  
      }
  }
  
  void Game::update()
  {
      
  }
  
  
  void Game::render()
  {   
      mWindow.clear(sf::Color::Red);
      player1.draw_player(mWindow);
      mWindow.display();
  }
  </code></pre>
  <p><em><strong>main.cpp</strong></em></p>
  <pre><code>#include &quot;Game.hpp&quot;
  
  int main()
  {
      Game game;
      game.Run();
  }
  </code></pre>
  <p>I don't think I will need to give code to hpp files.</p>