Error in simple SDL sample program November 23, 2008 07:50AM | Registered: 15 years ago Posts: 3 |
int main(int argc, char **argv) { //used surfaces SDL_Surface *screen = 0; SDL_Surface *screen_backup = 0; SDL_Surface *cursor = 0; SDL_Surface *bg_cursor = 0; SDL_Surface *temp = 0; //the system video is initialized if( SDL_Init(SDL_INIT_VIDEO) <0 ) { //SDL_GetError() returns a description of the error printf("Errore init SDL: %s\n", SDL_GetError()); pause(); return 1; } //when exit, execute SDL_Quit to restore everything atexit(SDL_Quit); //a 32 bit integer used to store screen's flags Uint32 flags = SDL_HWSURFACE|SDL_DOUBLEBUF; //SDL_SetVideoMode is used to have screen associated to the monitor if(!( screen = SDL_SetVideoMode(DIM_H, DIM_V, 0,flags) )) { printf("Problemi con il settaggio dello schermo: %s\n", SDL_GetError()); pause(); return 1; } //the original cursor must be turned off SDL_ShowCursor(0); //the sight's image is associated to a temporany surface if((temp = IMG_ReadXPMFromArray(tmpsight)) ==NULL) { printf("Error loading XPM: %s\n", IMG_GetError()); pause(); return 1; } ...
Re: Error in simple SDL sample program November 23, 2008 02:54PM | Registered: 15 years ago Posts: 13 |
Re: Error in simple SDL sample program November 23, 2008 09:40PM | Registered: 15 years ago Posts: 73 |
00000000 <IMG_ReadXPMFromArray>: 0: 38 60 00 00 li r3,0 4: 4e 80 00 20 blr
Re: Error in simple SDL sample program November 23, 2008 11:22PM | Registered: 15 years ago Posts: 3 |
Quote
Michael
Are you sure you have this function defined properly in your SDL_image lib? In the source code for SDL_image, this function is in an 'ifdef 'else block, where the 'else block defines a trivial version that returns NULL each time you call it.