while(isRunning){ while(SDL_PollEvent(&event) { if (event.type == SDL_QUIT) isRunning = false; } SDL_BlitSurface(test->image, &test->source , screen, &dest); SDL_Flip(screen);}
first, while(isRunning) is the same as while(isRunning == true), since isRunning is a boolean variable, it will evaluate to a boolean expression (as if there was a comparison there). so the '== true' is not needed.
second, you need to poll for events in a seperate loop, not in the same loop as the game. what happends if there is more then one event? in fact, you dont even check if SDL_PollEvent() returns true.
last, like EG said, you need to flip the screen. its hard to debug someone else's code, but:
make sure the image is loading. i believe that the loadimage call will return a NULL pointer. check for that.
secondly, try changing the blitsurface call to this:
SDL_BlitSurface(test->image,NULL, screen, &dest);
its been a while since i used SDL for rendering, but, why do you want to only draw a piece of your image, anyway?