summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-05-02 17:39:29 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-05-02 17:39:29 +0300
commit504ef7e9e322d3e0f483a45a1f993dc4ec1b94e9 (patch)
treebaaef78c1bdff980cfa9b182be0f3202c784e3e8 /indra/llwindow/llwindowmacosx.cpp
parent895ce616ea71b2001ec4e826b80310da80db9a0e (diff)
parent7ed52090a67882cd0bc904f1e0a9ce07cf6768e9 (diff)
Merge branch 'main' into DRTVWR-580-maint-T
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r--indra/llwindow/llwindowmacosx.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index a0fc91399b..2c841d4703 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;
@@ -654,6 +656,13 @@ 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);