summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-04-26 15:38:47 -0700
committerBrad Linden <brad@lindenlab.com>2023-04-26 15:38:47 -0700
commit369945b45da4697735bea7e925d87c65d90b2a5a (patch)
tree1c3d9af52d8e082b589085a87acad2d8a3f6ecd4 /indra/llwindow/llwindowmacosx.cpp
parent9f3f23ffa2ac487741be305068002536b872b015 (diff)
parent162a825dd59c23c9b475d75e0bd5169f3573267b (diff)
Merge remote-tracking branch 'origin/DRTVWR-539' into DRTVWR-559-merge-539
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 aae6539685..8bfaeca614 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);