error handling
This commit is contained in:
parent
9a11684363
commit
fbc667b321
1 changed files with 2 additions and 11 deletions
13
main.cpp
13
main.cpp
|
@ -90,22 +90,13 @@ auto poll_events(bool& continu) {
|
|||
} // namespace
|
||||
|
||||
int main() try {
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
std::println("fuck");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
sdl_check(SDL_Init(SDL_INIT_VIDEO));
|
||||
Defer<SDL_Quit> defer_SDL_Quit;
|
||||
|
||||
window_t window{SDL_CreateWindow(
|
||||
"random walk", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width,
|
||||
height, SDL_WINDOW_FULLSCREEN
|
||||
height, 0//SDL_WINDOW_FULLSCREEN
|
||||
)};
|
||||
if (!window) {
|
||||
std::println(
|
||||
"Window could not be created! SDL_Error: {}", SDL_GetError()
|
||||
);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// owned by window
|
||||
auto* window_surface = sdl_check(SDL_GetWindowSurface(window));
|
||||
|
|
Loading…
Reference in a new issue