For example:
SDL_Event e;
while( !quit )
{
while( SDL_PollEvent( &e ) != 0 )
{
if( e.type == SDL_QUIT )
{
quit = true;
}
}
SDL_Rect stretchRect;
stretchRect.x = 0;
stretchRect.y = 0;
stretchRect.w = WIDTH;
stretchRect.h = HEIGHT;
SDL_BlitScaled( optimizedSurface, NULL, gScreenSurface, &stretchRect );
SDL_UpdateWindowSurface( gWindow );
}