So still no text after a few hours of playing around with it........ -_-
I'm trying to convert the text back to a string with:
mouse_pos = sf::Mouse::getPosition(glWindow);
MousePosSS << "Mouse Pos: " << "X: " << mouse_pos.x << " Y: " << mouse_pos.y;
MousePosS = MousePosSS.str();
consoleLog.info(MousePosS);
CurserPosText.setString(MousePosSS.str());
sf::String myTest = CurserPosText.getString();
std::string myString = myTest.toAnsiString();
consoleLog.info(myString);
To see whats in it, to see if that's why it won't show up. Unfortunately this is making my program throw constant breaks for some reason. Any ideas? I really could use a break right about now, because I'm completely out of ideas.
So there I was one day, just clicking around in the debug window pretending to know what I'm doing, and I ran across this....
- m_font 0xcccccccc {m_library=??? m_face=??? m_streamRec=??? ...} const sf::Font *
Looks like the problem is the font yet.
I included a snippit of the error.
Tried to test some stuff......
Get this error:
Run-Time Check Failure #2 - Stack around the variable 'MyFont' was corrupted.
Came from:
DevHud::DevHud()
{
DevHudEnabled = false;
sf::Font MyFont;
if(!MyFont.loadFromFile("arial.ttf"))
{
}
CurserPosText.setFont(MyFont);
//Setting up defaults for font/text elements.
//fontUtils.SetupText(fontUtils.DevHud,DevHudFont,CurserPosText);
CurserPosText.setPosition(236,240);
CurserPosText.setCharacterSize(40);
}
o.O; Would seem my font became instantly corrupt.....
EDIT
Yep its official the problem is that the font is pointing to blank memory adresses, and as a result, the sf::text is getting currupt font data.
Still have no idea what to do about it. But now I know the root of the issue.
In short the error "I believe" is this:
It creates the Font object -> Loads the font in successfully -> ???Looses its Font info??? ->Tries to set a font to a invalid memory location *bam exception* or it is somehow successful and -> loads in the corrupt font data anyways -> Doesn't display anything because it was given bad memory locations when it tried to load the font and it is now corrupt.
Hope that makes some sense. I'm working on poking it with a stick right now.
Well after poking it with a stick several times. I have found something.
If I call:
fontUtils.SetupText(fontUtils.DevHud,DevHudFont,CurserPosText);
It can load its font just fine, it keeps its memory addresses, everything works well. However, the moment I tell a text object that its font is "DevHudFont" the fonts memory addresses show up as a bunch of "0"s in the debug window, and the text as a result gets corrupt font data.
Any ideas on why setting the font would make the font go batty? XD
[attachment deleted by admin]