Hi there!
I suspect that your sf::Texture* is uninitialized. Do you create your texture before you try to create your RoomObject? I got similar error when I used
sf::Texture *texture;
instead of
sf::Texture *texture = new sf::Texture();
After this you need to load a texture, because the line
thisShape.setTexture(spriteLoc);
will cause an error too, if spriteLoc is an initialized but empty texture.
I also have a tip for you. Use initializer lists in constructors, when you can:
RoomObject::RoomObject(sf::Texture* sprLoc, std::string name, int xLocation, int yLocation):
spriteLoc(sprLoc),objName(name),xLoc(xLocation),yLoc(yLocation)
{
thisShape.setFillColor(sf::Color::White);
thisShape.setPosition(xLoc * 32, yLoc * 32);
thisShape.setSize(sf::Vector2f(32, 32));
thisShape.setTexture(spriteLoc);
}
It works like this: you type a colon after the closing ) of your constructor, then you list your member variables as my_member(initialize_from_this) separated by comas. When you're done the open { follows, and you can continue with other statements (like setting the properties of thisShape).
This is better, because here the member variables are initialized directly from the variables. If you assign them in the body of the constructor, then they are created from some default values (this is unnecessary) and then assigned to your variables.