SFML 2.0
VS2012
Bug - Run-Time Check Failure #2 - Stack around the variable 'defaultFont' was corrupted.
Code in question:
void game::gui()
{
//Lives string
//Time string
sf::Font defaultFont;
if(!defaultFont.loadFromFile("arial.ttf"));
sf::Text playerScore;
playerScore.setFont(defaultFont);
//Display them
}
I'm making a simple gui for my platformer game, but i'm having a really strange bug whenever I use the SFML2.0 sf::Text function.
I would also like to point out that I do not have this error when I comment out all of the sf text and font.
I've double checked my references and double checked it against the build type. I'm building in debug mode, and the references have -d.
I've done a little bit of research, and from what i've collected I come to the conclusion that either:
- Using Memory that isn't there.
- Too much data being put on the stack
If these are the issue, i've never been taught memory management so not too sure how to rectify it.
Really confused about this and I need to develop my GUI.
Thanks guys