Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Better error reporting for video drivers with less than full function…
…ality.
  • Loading branch information
slouken committed Oct 15, 2014
1 parent 3b70f65 commit f7abb7c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/video/SDL_video.c
Expand Up @@ -1339,6 +1339,10 @@ SDL_CreateWindowFrom(const void *data)
SDL_UninitializedVideo();
return NULL;
}
if (!_this->CreateWindowFrom) {
SDL_Unsupported();
return NULL;
}
window = (SDL_Window *)SDL_calloc(1, sizeof(*window));
if (!window) {
SDL_OutOfMemory();
Expand All @@ -1356,8 +1360,7 @@ SDL_CreateWindowFrom(const void *data)
}
_this->windows = window;

if (!_this->CreateWindowFrom ||
_this->CreateWindowFrom(_this, window, data) < 0) {
if (_this->CreateWindowFrom(_this, window, data) < 0) {
SDL_DestroyWindow(window);
return NULL;
}
Expand Down Expand Up @@ -3181,11 +3184,13 @@ SDL_GetWindowWMInfo(SDL_Window * window, struct SDL_SysWMinfo *info)
CHECK_WINDOW_MAGIC(window, SDL_FALSE);

if (!info) {
SDL_InvalidParamError("info");
return SDL_FALSE;
}
info->subsystem = SDL_SYSWM_UNKNOWN;

if (!_this->GetWindowWMInfo) {
SDL_Unsupported();
return SDL_FALSE;
}
return (_this->GetWindowWMInfo(_this, window, info));
Expand Down

0 comments on commit f7abb7c

Please sign in to comment.