title: SFML only draws some sprites
body: <p>I'm having a strange problem where one sprite is loading however another isn't</p>
  
  <p>Here is my main.cpp</p>
  
  <pre><code>    window.draw(universe.getPlayer()-&gt;draw());  //Draw Player
  
      std::list&lt;AbstractBlock*&gt;::const_iterator i;
      std::list&lt;AbstractBlock*&gt;* values = universe.getLoadedBlocks();
  
      for (i = values-&gt;begin(); i != values-&gt;end(); ++i){
          window.draw((*i)-&gt;draw()); //Draw Blocks
      }
  
      window.display();
  </code></pre>
  
  <p>Here you can see the player drawing and all the blocks in the universe drawing. However, only the player draws and the blocks don't draw at all. I have made sure that the loop is actually working. However because draw() returns void I can't actually see if its working or not. </p>
  
  <p>Here is the DirtBlock.cpp (I'm inheriting from AbstractBlock)</p>
  
  <pre><code>DirtBlock::DirtBlock(int x, int y, float rotation, b2World *world){
      bodyDef.position.Set(x, y);
      bodyDef.linearDamping = .03f;
      bodyDef.type = b2_dynamicBody;
  
      fixDef.density = .1f;
  
      b2PolygonShape shape;
      shape.SetAsBox(16, 16);
  
      fixDef.shape = &amp;shape;
  
      body = world-&gt;CreateBody(&amp;bodyDef);
      body-&gt;CreateFixture(&amp;fixDef);
  
      texture.loadFromFile("Dirt.bmp");
  
      sprite.setTexture(texture);
      sprite.setOrigin(16, 16);
  
  
  }
  
  sf::Sprite DirtBlock::draw(){
      sprite.setPosition(body-&gt;GetPosition().x, body-&gt;GetPosition().y);
      return sprite;
  }
  </code></pre>
  
  <p>Not everything is included, only the stuff that is involved with the drawing.</p>
  
  <p>My Player class is very similar:</p>
  
  <pre><code>Player::Player(b2World *world){
  
      texture.loadFromFile("player.bmp");
      bodyDef.position.Set(10, 10);
      bodyDef.type = b2_dynamicBody;
      fixDef.density = .1f;
      b2PolygonShape shape;
      shape.SetAsBox(16, 16);
      fixDef.shape = &amp;shape;
  
      body = world-&gt;CreateBody(&amp;bodyDef);
      body-&gt;CreateFixture(&amp;fixDef);
      body-&gt;SetLinearDamping(.03f);
  
      sprite.setTexture(texture);
      sprite.setOrigin(16, 16);
  
      force = 10.f;
  
  }
  
  sf::Sprite Player::draw(){
      sprite.setPosition(body-&gt;GetPosition().x, body-&gt;GetPosition().y);
      sprite.setRotation(body-&gt;GetAngle() * (180 / b2_pi));
      return sprite;
  }
  </code></pre>
  
  <p>Since they are so similar why is one drawing and the other not? I have a feeling it might be because of my inheritance. I'm typically a Java programmer and I'm not 100% sure I did the inheritance correctly in C++. Should it be like this? (My DirtBlock.h)</p>
  
  <pre><code>class DirtBlock: public AbstractBlock
  {
  public:
      DirtBlock();
      DirtBlock(int x, int y, float rotation, b2World *world);
      ~DirtBlock();
      virtual sf::Sprite draw();
      virtual void destroy(b2World *world);
  private: 
      sf::Sprite sprite;
  };
  </code></pre>