SDL_ttf and Numbers (int)
- by jack moore
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.