summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2022-10-03 15:52:50 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2022-10-03 15:52:50 +0300
commit0bbe44c4b9df591ecfc451652b79cacb9087276d (patch)
treeb0df8f2020cf3bdc76c01cf115f3bd2291e5f138
parent198420f9f61bc0f747102a2d5783327f13583be8 (diff)
SL-17541 simple fallback when refresh rate is unknown
-rw-r--r--indra/llwindow/llwindowmacosx.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 66f7e60371..74878df781 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -49,6 +49,8 @@ BOOL gHiDPISupport = TRUE;
const S32 BITS_PER_PIXEL = 32;
const S32 MAX_NUM_RESOLUTIONS = 32;
+const S32 DEFAULT_REFRESH_RATE = 60;
+
namespace
{
NSKeyEventRef mRawKeyEvent = NULL;
@@ -661,6 +663,11 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
}
mRefreshRate = CGDisplayModeGetRefreshRate(CGDisplayCopyDisplayMode(mDisplay));
+ if(mRefreshRate == 0)
+ {
+ //consider adding more appropriate fallback later
+ mRefreshRate = DEFAULT_REFRESH_RATE;
+ }
// Disable vertical sync for swap
toggleVSync(enable_vsync);