Afternoon,
I'm working on some basic classes to have handy Labels, TextArea, InputBox, etc.
In all these, I use sf::text of course, and personal font as well and because of the default font crashing problem, I've been using pointers to sf::Text in order to control how they initialize directly in the class constructor and a normal sf::font to hold the font, within each class. I figured, that way, the sf::font will stay alive as long as the object is..so no problem there...
That solved the default font crash but I then started getting insanely "wtf" issues on the sf::text draw function, each one regarding fonts in particular, as if they're no longer there at some point while they ARE still in the sf::font variables that was used to create the sf::text, for each objects. Made ZERO sense.
Then I figured: alright, let's make a sf::font right there at the start, and pass it around. But same issue again, when the draw calls arrive, it goes and starts doing font stuff...then returns that there's nothing there.
It's like...when you create a sf::text, it stores some address of something related to the font but can't find it later on!
As a note, everything fine if I just let the default font handle this, but of course, it crashes later on...and I can't use custom fonts...
So my question is...
If you want to put all sf::text calls into a class (let's say Clabel) how do you handle the font?
Another question would be: how the hell does sf::font work in relation to sf::text and especially draw calls?
Thanks in advance, that's driving me nuts
edit:
- oh, I use latest SFML 2.0 files, freshly made via CMAKE, and I'm on VS2010. I do have an ATI card (think it's related to the font issue if I got it right).