SFML community forums

Help => Graphics => Topic started by: Grimshaw on August 20, 2011, 06:24:03 pm

Title: Weird problem with sf::Text
Post by: Grimshaw on August 20, 2011, 06:24:03 pm
Hello everyone,

Im not sure if this is a known issue, but here it goes!

There is a piece of code that won't work in a laptop, but works fine in my desktop. They are both windows 7, but very different in hardware and openGL versions...

So, i have a class, with a sf::Text* member, it is perfectly initialized and rendering fine, but i get trouble when i try to change its String.

I have something like this:

Code: [Select]
void OnEvent(sf::Event Event){
     myText->SetString("new text"); //this works fine in laptop and desktop

     if(Event.Type == sf::Event::KeyPressed){
           if(Event.Key.Code == sf::Keyboard::F){
                  cout<<"This gets printed just fine when pressed"<<endl;
                 
                  myText->SetString("tryyyy"); //this works in the desktop
                  //in the laptop, nothing changes at all, as well as any other calls like SetColor..
           }
     }
}


I hope it is understandable :)
Title: Weird problem with sf::Text
Post by: Laurent on August 21, 2011, 10:43:54 am
Have you tried to run it step by step with the debugger?