Skip to content

Commit

Permalink
Add isBrowserGPUEnabled lua definition (clientside)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lpsd committed Oct 19, 2024
1 parent 92a90cd commit 47cf382
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Client/mods/deathmatch/logic/luadefs/CLuaBrowserDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void CLuaBrowserDefs::LoadFunctions()
{"resizeBrowser", ResizeBrowser},
{"guiCreateBrowser", GUICreateBrowser},
{"guiGetBrowser", GUIGetBrowser},
{"isBrowserGPUEnabled", ArgumentParser<IsBrowserGPUEnabled>},
};

// Add browser functions
Expand Down Expand Up @@ -97,6 +98,7 @@ void CLuaBrowserDefs::AddClass(lua_State* luaVM)
lua_classvariable(luaVM, "renderingPaused", "setBrowserRenderingPaused", "isBrowserRenderingPaused");
lua_classvariable(luaVM, "volume", "setBrowserVolume", "getBrowserVolume");
lua_classvariable(luaVM, "devTools", "toggleBrowserDevTools", nullptr);
lua_classvariable(luaVM, "gpuEnabled", nullptr, "isBrowserGPUEnabled");

lua_registerclass(luaVM, "Browser", "DxTexture");

Expand Down Expand Up @@ -1054,3 +1056,8 @@ int CLuaBrowserDefs::SetBrowserAjaxHandler(lua_State* luaVM)
lua_pushboolean(luaVM, false);
return 1;
}

bool CLuaBrowserDefs::IsBrowserGPUEnabled()
{
return g_pCore->GetWebCore()->GetGPUEnabled();
}
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/luadefs/CLuaBrowserDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ class CLuaBrowserDefs : public CLuaDefs
LUA_DECLARE(ResizeBrowser);
LUA_DECLARE(GUICreateBrowser);
LUA_DECLARE(GUIGetBrowser);
static bool IsBrowserGPUEnabled();
};

0 comments on commit 47cf382

Please sign in to comment.