فهرست منبع

Show root cause error from SDL when SDL fails to create main window.

Yao Wei Tjong 姚伟忠 10 سال پیش
والد
کامیت
b1d6031673

+ 1 - 1
Source/Urho3D/Graphics/Direct3D11/D3D11Graphics.cpp

@@ -2172,7 +2172,7 @@ bool Graphics::OpenWindow(int width, int height, bool resizable, bool borderless
 
 
     if (!impl_->window_)
     if (!impl_->window_)
     {
     {
-        LOGERROR("Could not create window");
+        LOGERRORF("Could not create window, root cause: '%s'", SDL_GetError());
         return false;
         return false;
     }
     }
 
 

+ 1 - 1
Source/Urho3D/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -2367,7 +2367,7 @@ bool Graphics::OpenWindow(int width, int height, bool resizable, bool borderless
 
 
     if (!impl_->window_)
     if (!impl_->window_)
     {
     {
-        LOGERROR("Could not create window");
+        LOGERRORF("Could not create window, root cause: '%s'", SDL_GetError());
         return false;
         return false;
     }
     }
 
 

+ 3 - 3
Source/Urho3D/Graphics/OpenGL/OGLGraphics.cpp

@@ -476,7 +476,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
                 }
                 }
                 else
                 else
                 {
                 {
-                    LOGERROR("Could not open window");
+                    LOGERRORF("Could not create window, root cause: '%s'", SDL_GetError());
                     return false;
                     return false;
                 }
                 }
             }
             }
@@ -2417,7 +2417,7 @@ void Graphics::Restore()
         
         
         if (!impl_->context_)
         if (!impl_->context_)
         {
         {
-            LOGERROR("Could not create OpenGL context");
+            LOGERRORF("Could not create OpenGL context, root cause '%s'", SDL_GetError());
             return;
             return;
         }
         }
 
 
@@ -2429,7 +2429,7 @@ void Graphics::Restore()
         GLenum err = glewInit();
         GLenum err = glewInit();
         if (GLEW_OK != err)
         if (GLEW_OK != err)
         {
         {
-            LOGERROR("Could not initialize OpenGL extensions");
+            LOGERRORF("Could not initialize OpenGL extensions, root cause: '%s'", glewGetErrorString(err));
             return;
             return;
         }
         }