diff --git a/src/main.cc b/src/main.cc index 38f2b5d..f60159f 100644 --- a/src/main.cc +++ b/src/main.cc @@ -79,9 +79,15 @@ static Uint32 UpdateCallback(Uint32 interval, void * param) int main(int argc, char *argv[]) { + if (argc != 2) + { + fprintf(stderr, "Usage: %s \n", argv[0]); + return 1; + } + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER)) { - printf("Failed to initialize SDL!\n"); + fprintf(stderr, "Failed to initialize SDL!\n"); return 1; } @@ -95,7 +101,7 @@ int main(int argc, char *argv[]) SDL_WINDOW_OPENGL); if (!window) { - printf("Failed to create window!\n"); + fprintf(stderr, "Failed to create window!\n"); SDL_Quit(); return 2; } @@ -104,12 +110,12 @@ int main(int argc, char *argv[]) if (gl3wInit()) { - cerr << "Failed to initialize GL3W" << endl; + fprintf(stderr, "Failed to initialize GL3W"); return 2; } if (!gl3wIsSupported(3, 0)) { - cerr << "OpenGL 3.0 is not supported!" << endl; + fprintf(stderr, "OpenGL 3.0 is not supported!"); return 2; }