std::stringstream ss; ss << credits; std::string creditString = ss.str(); SDL_Surface* output = TTF_RenderText_Solid(font, ss.c_str(), color);which will allow you to blit the output surface to the screen, provided that you have already called TTF_Init() somewhere and loaded a font into the font variable. Also color is a SDL_Color.
Show differencesHistory of post edits
#ActualRulerOfNothing
Posted 10 January 2012 - 10:47 PM
well, you could use the following:
#1RulerOfNothing
Posted 10 January 2012 - 10:46 PM
well, you could use the following:
std::stringstream ss; ss << credits; std::string creditString = ss.str(); SDL_Surface* output = TTF_RenderText_Solid(font, ss.c_str(), color);which will allow you to blit the output surface to the screen, provided that you have already called TTF_Init() somewhere and loaded a font into the font variable.