1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);