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

Author Topic: Drawing text  (Read 719 times)

0 Members and 1 Guest are viewing this topic.

alexaz

  • Newbie
  • *
  • Posts: 4
    • View Profile
Drawing text
« on: November 04, 2011, 12:07:11 pm »
Hey guys,

i am wondering whether creating text element every frame is a viable option, this is what i mean:

Code: [Select]

void OnDraw(){
sf::Text text("The quick brown fox jumps over the lazy dog.", font, 72);
text.SetPosition(30.0f, 40.0f);
window->Draw(text);
}



Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Drawing text
« Reply #1 on: November 04, 2011, 12:15:02 pm »
Currently, it makes no difference (nothing is precomputed internally in sf::Text). But with the new graphics API that I'm working on, it will probably be better to initialize the sf::Text instance once, if it's never going to change.
Laurent Gomila - SFML developer

alexaz

  • Newbie
  • *
  • Posts: 4
    • View Profile
Drawing text
« Reply #2 on: November 04, 2011, 12:20:03 pm »
Oh, okay. Thanks for the quick response by the way!