Skip to content

Commit

Permalink
Improved error messages when Vulkan isn't configured (thanks Daniel G…
Browse files Browse the repository at this point in the history
…ibson!)
  • Loading branch information
slouken committed Apr 24, 2018
1 parent 8f780e7 commit 386790e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/video/SDL_video.c
Expand Up @@ -1000,7 +1000,7 @@ SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode *

/* Actually change the display mode */
if (!_this->SetDisplayMode) {
return SDL_SetError("Video driver doesn't support changing display mode");
return SDL_SetError("SDL video driver doesn't support changing display mode");
}
if (_this->SetDisplayMode(_this, display, &display_mode) < 0) {
return -1;
Expand Down Expand Up @@ -1383,7 +1383,9 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
#endif
if (flags & SDL_WINDOW_OPENGL) {
if (!_this->GL_CreateContext) {
SDL_SetError("No OpenGL support in video driver");
SDL_SetError("OpenGL support is either not configured in SDL "
"or not available in current SDL video driver "
"(%s) or platform", _this->name);
return NULL;
}
if (SDL_GL_LoadLibrary(NULL) < 0) {
Expand All @@ -1394,7 +1396,8 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
if (flags & SDL_WINDOW_VULKAN) {
if (!_this->Vulkan_CreateSurface) {
SDL_SetError("Vulkan support is either not configured in SDL "
"or not available in video driver");
"or not available in current SDL video driver "
"(%s) or platform", _this->name);
return NULL;
}
if (flags & SDL_WINDOW_OPENGL) {
Expand Down Expand Up @@ -1544,7 +1547,9 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
SDL_bool loaded_opengl = SDL_FALSE;

if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) {
return SDL_SetError("No OpenGL support in video driver");
return SDL_SetError("OpenGL support is either not configured in SDL "
"or not available in current SDL video driver "
"(%s) or platform", _this->name);
}

if (window->flags & SDL_WINDOW_FOREIGN) {
Expand Down Expand Up @@ -2787,7 +2792,7 @@ SDL_GL_LoadLibrary(const char *path)
retval = 0;
} else {
if (!_this->GL_LoadLibrary) {
return SDL_SetError("No dynamic GL support in video driver");
return SDL_SetError("No dynamic GL support in current SDL video driver (%s)", _this->name);
}
retval = _this->GL_LoadLibrary(_this, path);
}
Expand Down Expand Up @@ -2818,7 +2823,7 @@ SDL_GL_GetProcAddress(const char *proc)
SDL_SetError("No GL driver has been loaded");
}
} else {
SDL_SetError("No dynamic GL support in video driver");
SDL_SetError("No dynamic GL support in current SDL video driver (%s)", _this->name);
}
return func;
}
Expand Down Expand Up @@ -3985,7 +3990,9 @@ int SDL_Vulkan_LoadLibrary(const char *path)
retval = 0;
} else {
if (!_this->Vulkan_LoadLibrary) {
return SDL_SetError("No Vulkan support in video driver");
return SDL_SetError("Vulkan support is either not configured in SDL "
"or not available in current SDL video driver "
"(%s) or platform", _this->name);
}
retval = _this->Vulkan_LoadLibrary(_this, path);
}
Expand Down

0 comments on commit 386790e

Please sign in to comment.