mirror of https://github.com/mgba-emu/mgba.git
SDL: Better error checking
This commit is contained in:
parent
f05a385d6a
commit
f22391275b
|
@ -109,6 +109,9 @@ int main(int argc, char** argv) {
|
||||||
GBASDLRunloop(&context, &renderer);
|
GBASDLRunloop(&context, &renderer);
|
||||||
|
|
||||||
GBAThreadJoin(&context);
|
GBAThreadJoin(&context);
|
||||||
|
if (GBAThreadHasCrashed(&context)) {
|
||||||
|
printf("The game crashed!\n");
|
||||||
|
}
|
||||||
freeArguments(&args);
|
freeArguments(&args);
|
||||||
GBAConfigFreeOpts(&opts);
|
GBAConfigFreeOpts(&opts);
|
||||||
GBAConfigDeinit(&config);
|
GBAConfigDeinit(&config);
|
||||||
|
@ -122,6 +125,7 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
static bool _GBASDLInit(struct SDLSoftwareRenderer* renderer) {
|
static bool _GBASDLInit(struct SDLSoftwareRenderer* renderer) {
|
||||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||||
|
printf("Could not initialize video: %s\n", SDL_GetError());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue