SDL_ttf and Numbers (int)

Posted by jack moore on Stack Overflow See other posts from Stack Overflow or by jack moore
Published on 2010-06-18T04:39:47Z Indexed on 2010/06/18 4:43 UTC
Read the original article Hit count: 300

Filed under:
|
int score = 0;
char* fixedscore=(char*)score;
.
.
.
imgTxt = TTF_RenderText_Solid( font, fixedscore, fColor );

^^ This doesn't work - looks like fixedscore is empty or doesn't exists.

int score = 0;
char* fixedscore=(char*)score;
.
.
.
imgTxt = TTF_RenderText_Solid( font, "Works fine", fColor );

^^ Works fine, but...

I guess converting int to char* doesn't really work. So how do you print scores in SDL? Oh and one more thing: why is the text so ugly?

Any help would be appreciated. Thanks.

© Stack Overflow or respective owner

Related posts about c++

Related posts about sdl