]> git.sesse.net Git - movit/commitdiff
Merge remote-tracking branch 'origin/master'
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Jan 2013 22:59:19 +0000 (23:59 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Jan 2013 22:59:19 +0000 (23:59 +0100)
1  2 
gtest_sdl_main.cpp

diff --combined gtest_sdl_main.cpp
index 21c923aa755a185e98ea5b9c817e024df750d223,8a2fa9eafa5eca6ac2fe044932dabc3c74f94602..fa3a835cda7f167e00b199535a68d28ae23ec0f2
@@@ -1,11 -1,12 +1,14 @@@
 +#define GTEST_HAS_EXCEPTIONS 0
 +
  #include <SDL/SDL.h>
  #include "gtest/gtest.h"
  
  int main(int argc, char **argv) {
        // Set up an OpenGL context using SDL.
-       SDL_Init(SDL_INIT_VIDEO);
+       if (SDL_Init(SDL_INIT_VIDEO) == -1) {
+               fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
+               exit(1);
+       }
        SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
        SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 0);
        SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);