|
Size: 1074
Comment: update content (w/ Sam); remove 'draft' note
|
Size: 1082
Comment: minor change
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 17: | Line 17: |
| This string is statically allocated and must not be freed by the user. | This string is statically allocated and must not be freed by the application. |
| Line 21: | Line 21: |
| if (SDL_Init( SDL_INIT_EVERYTHING ) <0) { | if (SDL_Init( SDL_INIT_EVERYTHING ) < 0) { |
SDL_GetError
Use this function to retrieve a message about the last error that occurred.
Syntax
const char* SDL_GetError(void)
Return Value
Returns a message with information about the specific error that occurred, or an empty string if there hasn't been an error since the last call to SDL_ClearError().
This string is statically allocated and must not be freed by the application.
Code Examples
if (SDL_Init( SDL_INIT_EVERYTHING ) < 0) {
// Unrecoverable error, exit here.
printf("SDL_Init failed: %s\n", SDL_GetError());
}
Note: Although this example uses SDL_Init(), SDL_GetError() provides an error message for any failed SDL operation.
Remarks
It is possible for multiple errors to occur before calling SDL_GetError(). Only the last error is returned.
