SDL_BlitSurface( creditString, NULL, screen, NULL);
Or more importantly, isn't this throwing an error at you as well? Because when I look at the SDL reference docs, the first argument of SDL_BlitSurface definitely isn't a std::string...
Posted 10 January 2012 - 11:24 PM
SDL_BlitSurface( creditString, NULL, screen, NULL);
Posted 10 January 2012 - 11:53 PM
Posted 11 January 2012 - 12:02 AM
Posted 11 January 2012 - 08:59 AM
Posted 11 January 2012 - 12:51 PM
Posted 11 January 2012 - 06:49 PM
std::stringstream ss;
ss << score;
std::string creditString = creditString.c_str();
score + 5;
output = TTF_RenderText_Solid(font, ss.str().c_str(), textColor);
apply_surface(0, 0, background, screen);
//apply surfaces
apply_surface( 0, 0, output, screen );
//Update screen
if ( SDL_Flip (screen) == -1 )
{
return 1;
}
//while quit is false
while ( quit == false)
{
//while there event to handle
while ( SDL_PollEvent ( &event ))
{
//if the user hasn't quit
if ( event.type == SDL_QUIT )
{
//if the user hasnt Xed
quit = true;
}
score + 5;
apply_surface(0, 150, output, screen);
//Update screen
if ( SDL_Flip (screen) == -1 )
{
return 1;
}
}
}
Posted 11 January 2012 - 06:56 PM
Posted 11 January 2012 - 07:11 PM
int scoreAdd()
{
int x;
x = score;
x + 5;
return x;
}
void integerString()
{
std::stringstream ss;
ss << score;
std::string creditString = creditString.c_str();
output = TTF_RenderText_Solid(font, ss.str().c_str(), textColor);
}
Posted 11 January 2012 - 07:21 PM
Posted 11 January 2012 - 09:26 PM
Posted 11 January 2012 - 11:31 PM