@K-Bal - Yep I am sure actually I can get one of the images to display if you uncomment a line that loads the image again in Game.cpp but its kinda a dumb workaround for it :/
Maybe you assign the sprite a image which is only temporarily available like a local variable in a function? My fortune telling was better some years ago
That couldn't be it. I made it a member variable of my class :/
class DrawingThing : public sf::Drawable
{
public:
DrawingThing();
~DrawingThing();
void Render(sf::RenderTarget& target) const;
private:
sf::Sprite sprite;
sf::Image* image;
};
In the constructor I load the image and set a sprite to that image and then in the render method I display that sprite
but I also have a game class (which has the class above as a member variable) and I load the same image there that I am trying to load in the Board class and it works and it doesn't make any sense to me on why that happens :| I never create a sprite to hold the image in the Game class I just have an image and load it and the one in the other class displays mysteriously...
Update
Here is my latest code
#include "DrawingThing.hpp"
using namespace sf;
Image hey;
DrawingThing::DrawingThing() : Drawable()
{
if (!hey.LoadFromFile("hey.png"))
printf("HEY IT DIDN'T LOAD");
sprite.SetImage(hey);
}
DrawingThing::~DrawingThing()
{
}
void DrawingThing::Render(RenderTarget& target) const
{
target.Draw(sprite);
}
It still gives the same effect :/