Hello all.
Been hunting down a disguising problem with a game I've written and I gave up and so wrote the game up from the ground again, but this time compiling release at every major stage too.
Well I've hit the error again - this time I've worked out what it is.. sf::text.
if I load a font its fine, but the second I apply it to a sf::text it was crashing on exit.
after an hour of debugging I found the problem... if I set the string inside the sf::text before the font it set, it causes the problem. EG.
if(!mFont.loadFromFile("Data/Fonts/comic.ttf"))
std::cout << "Fail to load font.. " << std::endl;
mText.setString("Press Space.");
mText.setFont(mFont);
mText.setOrigin(mText.getGlobalBounds().width / 2.0f, mText.getGlobalBounds().height / 2.0f);
mText.setPosition(this->GetEnginePtr()->GetGraphics()->GetWindow().getSize().x / 2.0f,
this->GetEnginePtr()->GetGraphics()->GetWindow().getSize().y / 2.0f);
mText.setColor(sf::Color::Blue);
that above will cause a release build crash on exit.
if(!mFont.loadFromFile("Data/Fonts/comic.ttf"))
std::cout << "Fail to load font.. " << std::endl;
mText.setFont(mFont);
mText.setString("Press Space.");
mText.setOrigin(mText.getGlobalBounds().width / 2.0f, mText.getGlobalBounds().height / 2.0f);
mText.setPosition(this->GetEnginePtr()->GetGraphics()->GetWindow().getSize().x / 2.0f,
this->GetEnginePtr()->GetGraphics()->GetWindow().getSize().y / 2.0f);
mText.setColor(sf::Color::Blue);
However - the above code will work fine.
I could not find mention in the documentation that the process had to be so strict?
I am using AMD 6990 GFX.