add mySDL_GetError

This commit is contained in:
Glenn Maynard
2004-04-09 21:52:50 +00:00
parent c885c95ee0
commit 11843f12be
2 changed files with 14 additions and 0 deletions
+12
View File
@@ -1269,3 +1269,15 @@ SDL_Surface *mySDL_MakeDummySurface( int height, int width )
return ret_image;
}
/* SDL sometimes fails to set an error, in which case we get the null string. We
* sometimes use that as a sentinel return value. This function returns "(none)"
* if no error is set. */
CString mySDL_GetError()
{
CString error = SDL_GetError();
if( error == "" )
return "(none)"; /* SDL sometimes fails to set an error */
return error;
}