Sanity check the window width and height

This commit is contained in:
Sam Lantinga 2012-01-22 23:51:46 -05:00
parent e2e9ecfa1f
commit f4c0910b5b

View File

@ -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;