Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Weird problem with sf::Text  (Read 1385 times)

0 Members and 1 Guest are viewing this topic.

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Weird problem with sf::Text
« 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 :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Weird problem with sf::Text
« Reply #1 on: August 21, 2011, 10:43:54 am »
Have you tried to run it step by step with the debugger?
Laurent Gomila - SFML developer