Add those two lines in the beginning of your program and it shoud work:
int main(int argc, char *argv[]){ SDL_Event event; int gameover=0; // Add following two lines SDL_Init(SDL_INIT_VIDEO); SDL_SetVideoMode(320, 200, 0, SDL_ANYFORMAT); while(!gameover) { if(SDL_PollEvent(&event)) { switch(event.type) { case SDL_KEYDOWN: switch(event.key.keysym.sym) { case SDLK_ESCAPE: case SDLK_q: gameover=1; break; } // end switch break; } // end switch } // end if } // end while return 0;}
[edited by - baumep on June 9, 2003 6:01:05 AM]