chore(style): clarified InitSDL error conditions
This commit is contained in:
parent
0cec7f1203
commit
37a412ea40
|
|
@ -67,11 +67,11 @@ void InitSDL() {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "SDL_Init failed: %s", SDL_GetError());
|
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "SDL_Init failed: %s", SDL_GetError());
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if ((window = SDL_CreateWindow("Window", screenWidth, screenHeight, sdlInitFlags)) == nullptr) {
|
if (!(window = SDL_CreateWindow("Window", screenWidth, screenHeight, sdlInitFlags))) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "SDL_CreateWindow failed: %s", SDL_GetError());
|
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "SDL_CreateWindow failed: %s", SDL_GetError());
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
if ((renderer = SDL_CreateRenderer(window, NULL)) == nullptr) {
|
if (!(renderer = SDL_CreateRenderer(window, NULL))) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "SDL_CreateRenderer failed: %s", SDL_GetError());
|
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "SDL_CreateRenderer failed: %s", SDL_GetError());
|
||||||
exit(3);
|
exit(3);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue