title: sf::Texture as class member doesn't work?
body: <p>Heyy, I want to draw a sprite in my SFML application but its texture is always white when I use an image and a texture that are class members</p>
  
  <p>Class members:</p>
  
  <pre><code>sf::Sprite myimg;
  sf::Image myimg_image;
  sf::Texture myimg_texture;
  </code></pre>
  
  <p>When I then create the sprite like this in my cpp file</p>
  
  <pre><code>// create image
  myimg_image.create(icon.width, icon.height, icon.pixelData);
  
  // create texture from image
  myimg_texture.create(icon.width, icon.height);
  myimg_texture.update(myimg_image);
  
  // apply texture to sprite
  myimg.setTexture(myimg_texture);
  </code></pre>
  
  <p>It only draws a white sprite when I draw it with window.draw(myimg)</p>
  
  <p>(icon is a struct that contains the image information.. it's just the image I want to use exported as C source with GIMP)</p>
  
  <p>I experimented a bit and realised that when I create the above mentioned class members not as class members but as local variables within the main function, the image is drawn properly...</p>
  
  <p>But that doesn't help me as I need them as members because I want to access them from other functions as well</p>
  
  <p>Can you please help me I just don't know what to do anymore :(</p>