mirror of
https://github.com/yawut/SDL.git
synced 2026-08-22 00:35:18 -05:00
Sanity check the window width and height
This commit is contained in:
@@ -1145,6 +1145,14 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
|
||||
}
|
||||
}
|
||||
|
||||
/* Some platforms can't create zero-sized windows */
|
||||
if (w < 1) {
|
||||
w = 1;
|
||||
}
|
||||
if (h < 1) {
|
||||
h = 1;
|
||||
}
|
||||
|
||||
/* Some platforms have OpenGL enabled by default */
|
||||
#if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__
|
||||
flags |= SDL_WINDOW_OPENGL;
|
||||
|
||||
Reference in New Issue
Block a user