I am trying to display a Text object and I am receiving an error when I try sending it to the draw function in my sf::RenderWindow object. Bear in mind that I was originally a java programmer so I might be doing something that only works in java (but I doubt it).
The exception looks like (though I doubt it will do any good because it seems like it is sending me the location in the runtime memory the exception is occuring):
Exception thrown at 0x548EAB3F (sfml-graphics-d-2.dll) in Survior.exe: 0xC0000005: Access violation reading location 0xCCCCCD24. occurred
//where exception in relayed
void TextInteraction::textDisplay() {
//displays regular text white
MainWindow::window.draw(*text);
}
//constructor
TextInteraction::TextInteraction(RECT box, std::string _text, sf::Font font, int size, float x, float y) : HitBox(box) {
text = new sf::Text(_text, font, size);
text->setOrigin(x, y);
text->setColor(sf::Color::White);
}