SDL: Better error checking

This commit is contained in:
Jeffrey Pfau 2015-01-08 20:04:59 -08:00
parent f05a385d6a
commit f22391275b
1 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,9 @@ int main(int argc, char** argv) {
GBASDLRunloop(&context, &renderer);
GBAThreadJoin(&context);
if (GBAThreadHasCrashed(&context)) {
printf("The game crashed!\n");
}
freeArguments(&args);
GBAConfigFreeOpts(&opts);
GBAConfigDeinit(&config);
@ -122,6 +125,7 @@ int main(int argc, char** argv) {
static bool _GBASDLInit(struct SDLSoftwareRenderer* renderer) {
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
printf("Could not initialize video: %s\n", SDL_GetError());
return false;
}