1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

Add Irrlicht device info to the mainmenu About tab (#13636)

This commit is contained in:
DS
2023-07-17 20:44:54 +02:00
committed by GitHub
parent 9b310a6e6f
commit f41e9e3e0f
5 changed files with 37 additions and 3 deletions

View File

@@ -964,6 +964,23 @@ int ModApiMainMenu::l_get_active_renderer(lua_State *L)
return 1;
}
/******************************************************************************/
int ModApiMainMenu::l_get_active_irrlicht_device(lua_State *L)
{
const char *device_name = [] {
switch (RenderingEngine::get_raw_device()->getType()) {
case EIDT_WIN32: return "WIN32";
case EIDT_X11: return "X11";
case EIDT_OSX: return "OSX";
case EIDT_SDL: return "SDL";
case EIDT_ANDROID: return "ANDROID";
default: return "Unknown";
}
}();
lua_pushstring(L, device_name);
return 1;
}
/******************************************************************************/
int ModApiMainMenu::l_get_min_supp_proto(lua_State *L)
{
@@ -1108,6 +1125,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
API_FCT(get_window_info);
API_FCT(get_active_driver);
API_FCT(get_active_renderer);
API_FCT(get_active_irrlicht_device);
API_FCT(get_min_supp_proto);
API_FCT(get_max_supp_proto);
API_FCT(open_url);

View File

@@ -110,6 +110,8 @@ private:
static int l_get_active_renderer(lua_State *L);
static int l_get_active_irrlicht_device(lua_State *L);
//filesystem
static int l_get_mainmenu_path(lua_State *L);