[SDL] Error with SDL at program end

Greg Blachut the.yellow.dart.greg at gmail.com
Tue Jul 19 14:38:58 PDT 2005


I have a c++ class (for using text) that uses SDL_LoadBMP() to load a
bitmap, from a directory, to use in drawing to the screen.  I normally
use this function to load it:

SDL_Surface * ImageLoad(char *file)
{
  SDL_Surface *temp1, *temp2;
  temp1 = SDL_LoadBMP(file);
  temp2 = SDL_DisplayFormat(temp1);
  SDL_FreeSurface(temp1);
  return temp2;
}

Whenever I use this, however, and the program ends because I exit it,
an error report message box pops up saying that SDL has encountered an
error and needs to close, please send this to microsoft, etc.

If I simply use:  SDL_LoadBMP(), and dont call a separate function, it
works fine and does not give me any errors.

Also, if I use SDL_DisplayFormat() in the same area as the above
situation, I still get an error.

If I use SDL_DisplayFormat() in my Main.cpp file, no error.

Basically, whenever I call SDL_DisplayFormat() in any function that is
not located in my main.cpp file, I get this error.  Does anyone know
what can be wrong?




More information about the SDL mailing list