Correctly handle SDL_GetCurrentDisplayMode return value
This commit is contained in:
parent
f137bad7f8
commit
a0a0e6c498
@ -174,18 +174,15 @@ void SDLOpen()
|
|||||||
desktopWidth = rect.w;
|
desktopWidth = rect.w;
|
||||||
desktopHeight = rect.h;
|
desktopHeight = rect.h;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (Client::Ref().GetPrefBool("AutoDrawLimit", false))
|
if (Client::Ref().GetPrefBool("AutoDrawLimit", false))
|
||||||
{
|
{
|
||||||
SDL_DisplayMode displayMode;
|
SDL_DisplayMode displayMode;
|
||||||
SDL_GetCurrentDisplayMode(displayIndex, &displayMode);
|
if (!SDL_GetCurrentDisplayMode(displayIndex, &displayMode) && displayMode.refresh_rate >= 60)
|
||||||
|
|
||||||
if(displayMode.refresh_rate >= 60)
|
|
||||||
{
|
{
|
||||||
ui::Engine::Ref().SetDrawingFrequencyLimit(displayMode.refresh_rate);
|
ui::Engine::Ref().SetDrawingFrequencyLimit(displayMode.refresh_rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WIN
|
#ifdef WIN
|
||||||
SDL_SysWMinfo SysInfo;
|
SDL_SysWMinfo SysInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user