Move love.system.getTheme() to love.window.getSystemTheme().

Despite its name, `SDL_GetSystemTheme()` needs the video subsystem to properly function. So, put it in love.window instead.
This commit is contained in:
Miku AuahDark
2025-11-25 15:29:24 +08:00
parent 139a45bfae
commit c4d30081f4
10 changed files with 60 additions and 64 deletions
+10
View File
@@ -765,6 +765,15 @@ int w_getPointer(lua_State *L)
return 1;
}
int w_getSystemTheme(lua_State *L)
{
Window::SystemTheme theme = instance()->getSystemTheme();
const char *str = "unknown";
Window::getConstant(theme, str);
lua_pushstring(L, str);
return 1;
}
static const luaL_Reg functions[] =
{
{ "getDisplayCount", w_getDisplayCount },
@@ -809,6 +818,7 @@ static const luaL_Reg functions[] =
{ "showFileDialog", w_showFileDialog },
{ "requestAttention", w_requestAttention },
{ "getPointer", w_getPointer },
{ "getSystemTheme", w_getSystemTheme },
{ 0, 0 }
};