Browse Source

Show SDL error message on init failure

Jonathan Adamczewski 10 years ago
parent
commit
f158617551
1 changed files with 3 additions and 0 deletions
  1. 3 0
      examples/sdl_opengl_example/main.cpp

+ 3 - 0
examples/sdl_opengl_example/main.cpp

@@ -10,7 +10,10 @@ int main(int, char**)
 {
 {
     // Setup SDL
     // Setup SDL
 	if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
 	if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
+	{
+        printf("Error: %s", SDL_GetError());
         return -1;
         return -1;
+	}
 
 
     // Setup window
     // Setup window
 	SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
 	SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);