]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
exit on error
authorClyne Sullivan <tullivan99@gmail.com>
Tue, 8 Sep 2015 23:01:49 +0000 (19:01 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Tue, 8 Sep 2015 23:01:49 +0000 (19:01 -0400)
src/main.cpp

index 9ce98a18421797179843fd50e62f45dde4749429..27cc080ad713f973cfac57b4969e4dac32e020d0 100644 (file)
@@ -13,6 +13,7 @@ int main(int argc,char **argv){
     //runs start-up procedures
     if(SDL_Init(SDL_INIT_VIDEO) < 0){
                std::cout << "SDL was not able to initialize! Error: " << SDL_GetError() << std::endl;
+               return -1;
        }else{
                atexit(SDL_Quit);
                //Turn on double Buffering
@@ -25,6 +26,7 @@ int main(int argc,char **argv){
                                   );
         if(window == NULL){
                std::cout << "The window failed to generate! Error: " << SDL_GetError() << std::endl;
+               return -1;
         }else{
             //set OpenGL context
             mainGLContext = SDL_GL_CreateContext(window);