MSVC: Fix SDL binary assertion failure on start.

sdlReadDesktopVideoMode() was apparently being called when the window
pointer is NULL.

Wrap the code in an `if (window) { ... }`.

SDL binary now launches correctly.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2019-12-10 23:41:40 +00:00
parent cf9a88dfc3
commit d0d087511f
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 6 additions and 4 deletions

View File

@ -763,10 +763,12 @@ void sdlReadBattery()
void sdlReadDesktopVideoMode()
{
SDL_DisplayMode dm;
SDL_GetDesktopDisplayMode(SDL_GetWindowDisplayIndex(window), &dm);
desktopWidth = dm.w;
desktopHeight = dm.h;
if (window) {
SDL_DisplayMode dm;
SDL_GetDesktopDisplayMode(SDL_GetWindowDisplayIndex(window), &dm);
desktopWidth = dm.w;
desktopHeight = dm.h;
}
}
static void sdlResizeVideo()