Skip to content

Commit 4c5dec0

Browse files
committed
Add Lua hook in RageDisplay to get Display Refresh Rate
1 parent c7093ed commit 4c5dec0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/RageUtil/Graphics/RageDisplay.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,10 +1313,18 @@ class LunaRageDisplay : public Luna<RageDisplay>
13131313
return 1;
13141314
}
13151315

1316+
static int GetDisplayRefreshRate(T* p, lua_State* L)
1317+
{
1318+
VideoModeParams params = *p->GetActualVideoModeParams();
1319+
lua_pushnumber(L, params.rate);
1320+
return 1;
1321+
}
1322+
13161323
LunaRageDisplay()
13171324
{
13181325
ADD_METHOD(GetDisplayWidth);
13191326
ADD_METHOD(GetDisplayHeight);
1327+
ADD_METHOD(GetDisplayRefreshRate);
13201328
ADD_METHOD(GetFPS);
13211329
ADD_METHOD(GetVPF);
13221330
ADD_METHOD(GetCumFPS);

0 commit comments

Comments
 (0)