Improved error messages when Vulkan isn't configured (thanks Daniel Gibson!)
authorSam Lantinga <slouken@libsdl.org>
Mon, 23 Apr 2018 22:29:14 -0700
changeset 11954bc2aba33ae1f
parent 11953 3f40e902e8f8
child 11955 719dece50dde
Improved error messages when Vulkan isn't configured (thanks Daniel Gibson!)
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Mon Apr 23 22:17:56 2018 -0700
     1.2 +++ b/src/video/SDL_video.c	Mon Apr 23 22:29:14 2018 -0700
     1.3 @@ -1000,7 +1000,7 @@
     1.4  
     1.5      /* Actually change the display mode */
     1.6      if (!_this->SetDisplayMode) {
     1.7 -        return SDL_SetError("Video driver doesn't support changing display mode");
     1.8 +        return SDL_SetError("SDL video driver doesn't support changing display mode");
     1.9      }
    1.10      if (_this->SetDisplayMode(_this, display, &display_mode) < 0) {
    1.11          return -1;
    1.12 @@ -1383,7 +1383,9 @@
    1.13  #endif
    1.14      if (flags & SDL_WINDOW_OPENGL) {
    1.15          if (!_this->GL_CreateContext) {
    1.16 -            SDL_SetError("No OpenGL support in video driver");
    1.17 +            SDL_SetError("OpenGL support is either not configured in SDL "
    1.18 +                         "or not available in current SDL video driver "
    1.19 +                         "(%s) or platform", _this->name);
    1.20              return NULL;
    1.21          }
    1.22          if (SDL_GL_LoadLibrary(NULL) < 0) {
    1.23 @@ -1394,7 +1396,8 @@
    1.24      if (flags & SDL_WINDOW_VULKAN) {
    1.25          if (!_this->Vulkan_CreateSurface) {
    1.26              SDL_SetError("Vulkan support is either not configured in SDL "
    1.27 -                         "or not available in video driver");
    1.28 +                         "or not available in current SDL video driver "
    1.29 +                         "(%s) or platform", _this->name);
    1.30              return NULL;
    1.31          }
    1.32          if (flags & SDL_WINDOW_OPENGL) {
    1.33 @@ -1544,7 +1547,9 @@
    1.34      SDL_bool loaded_opengl = SDL_FALSE;
    1.35  
    1.36      if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) {
    1.37 -        return SDL_SetError("No OpenGL support in video driver");
    1.38 +        return SDL_SetError("OpenGL support is either not configured in SDL "
    1.39 +                            "or not available in current SDL video driver "
    1.40 +                            "(%s) or platform", _this->name);
    1.41      }
    1.42  
    1.43      if (window->flags & SDL_WINDOW_FOREIGN) {
    1.44 @@ -2787,7 +2792,7 @@
    1.45          retval = 0;
    1.46      } else {
    1.47          if (!_this->GL_LoadLibrary) {
    1.48 -            return SDL_SetError("No dynamic GL support in video driver");
    1.49 +            return SDL_SetError("No dynamic GL support in current SDL video driver (%s)", _this->name);
    1.50          }
    1.51          retval = _this->GL_LoadLibrary(_this, path);
    1.52      }
    1.53 @@ -2818,7 +2823,7 @@
    1.54              SDL_SetError("No GL driver has been loaded");
    1.55          }
    1.56      } else {
    1.57 -        SDL_SetError("No dynamic GL support in video driver");
    1.58 +        SDL_SetError("No dynamic GL support in current SDL video driver (%s)", _this->name);
    1.59      }
    1.60      return func;
    1.61  }
    1.62 @@ -3985,7 +3990,9 @@
    1.63          retval = 0;
    1.64      } else {
    1.65          if (!_this->Vulkan_LoadLibrary) {
    1.66 -            return SDL_SetError("No Vulkan support in video driver");
    1.67 +            return SDL_SetError("Vulkan support is either not configured in SDL "
    1.68 +                                "or not available in current SDL video driver "
    1.69 +                                "(%s) or platform", _this->name);
    1.70          }
    1.71          retval = _this->Vulkan_LoadLibrary(_this, path);
    1.72      }