mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Show SDL version in the About tab (#16046)
This commit is contained in:
parent
2bb7ed208c
commit
bf15036831
3 changed files with 21 additions and 3 deletions
|
@ -945,8 +945,9 @@ int ModApiMainMenu::l_get_active_renderer(lua_State *L)
|
|||
/******************************************************************************/
|
||||
int ModApiMainMenu::l_get_active_irrlicht_device(lua_State *L)
|
||||
{
|
||||
const char *device_name = [] {
|
||||
switch (RenderingEngine::get_raw_device()->getType()) {
|
||||
auto device = RenderingEngine::get_raw_device();
|
||||
std::string device_name = [device] {
|
||||
switch (device->getType()) {
|
||||
case EIDT_WIN32: return "WIN32";
|
||||
case EIDT_X11: return "X11";
|
||||
case EIDT_OSX: return "OSX";
|
||||
|
@ -955,7 +956,9 @@ int ModApiMainMenu::l_get_active_irrlicht_device(lua_State *L)
|
|||
default: return "Unknown";
|
||||
}
|
||||
}();
|
||||
lua_pushstring(L, device_name);
|
||||
if (auto version = device->getVersionString(); !version.empty())
|
||||
device_name.append(" " + version);
|
||||
lua_pushstring(L, device_name.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue