>///< i feel like a noob having trouble in SDL but
i get an error In function `int SDL_main(int, char**)':
`void SDL_Quit()' cannot appear in a constant-expression
Makefile.win [Build Error] [window.o] Error 1
oohh i didn't add the includes up in that copy but there cstdlib,cstdio, SDL.h, and the defines for WIDTH,HEIGHT, and BPP :PCode:int main(int argc, char *argv[]) { if(SDL_Init(SDL_INIT_VIDEO) < 0) { fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError()); exit(1); } SDL_Surface *screen; screen = SDL_SetVideoMode(SCREEN_WIDTH,SCREEN_HEIGHT,SCREEN_BPP,SDL_SWSURFACE); if(screen == NULL) { printf("Unable to set video mode:%s\n",SDL_GetError()); exit(1); } SDL_WM_SetCaption("Justin's game",0); { SDL_Event event; SDL_WaitEvent(&event); switch(event.type) { case SDL_KEYDOWN: printf("The %s key was pressed!\n", SDL_GetKeyName(event.key.keysym.sym)); break; case SDL_Quit: exit(0); } } }



LinkBack URL
About LinkBacks




