mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-27 19:19:41 +08:00
Added an error message when SDL_GetWindowFromID() fails
This commit is contained in:
@@ -2649,13 +2649,17 @@ SDL_Window *SDL_GetWindowFromID(SDL_WindowID id)
|
|||||||
SDL_Window *window;
|
SDL_Window *window;
|
||||||
|
|
||||||
if (!_this) {
|
if (!_this) {
|
||||||
|
SDL_UninitializedVideo();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
for (window = _this->windows; window; window = window->next) {
|
if (id) {
|
||||||
if (window->id == id) {
|
for (window = _this->windows; window; window = window->next) {
|
||||||
return window;
|
if (window->id == id) {
|
||||||
|
return window;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SDL_SetError("Invalid window ID"); \
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user