mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-02 15:47:31 +08:00
Don't fail to create a window if it's too large, just clamp it to the max instead
Some window is better than no window...
This commit is contained in:
@@ -1858,9 +1858,11 @@ static SDL_Window *SDL_CreateWindowInternal(const char *title, int x, int y, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Some platforms blow up if the windows are too large. Raise it later? */
|
/* Some platforms blow up if the windows are too large. Raise it later? */
|
||||||
if ((w > 16384) || (h > 16384)) {
|
if (w > 16384) {
|
||||||
SDL_SetError("Window is too large.");
|
w = 16384;
|
||||||
return NULL;
|
}
|
||||||
|
if (h > 16384) {
|
||||||
|
h = 16384;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SDL_WINDOWPOS_ISUNDEFINED(x) || SDL_WINDOWPOS_ISUNDEFINED(y) ||
|
if (SDL_WINDOWPOS_ISUNDEFINED(x) || SDL_WINDOWPOS_ISUNDEFINED(y) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user