SFML community forums

Help => General => Topic started by: alexaz on November 04, 2011, 12:07:11 pm

Title: Drawing text
Post by: alexaz 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);
}


Title: Drawing text
Post by: Laurent 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.
Title: Drawing text
Post by: alexaz on November 04, 2011, 12:20:03 pm
Oh, okay. Thanks for the quick response by the way!