mirror of
https://github.com/yawut/SDL.git
synced 2026-04-24 15:26:55 -05:00
Sanity check the window width and height
This commit is contained in:
parent
e2e9ecfa1f
commit
f4c0910b5b
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user