Added love.window.setScreenSaverEnabled and love.window.isScreenSaverEnabled (resolves issue #1088.)

This commit is contained in:
Alex Szpakowski
2015-11-24 22:16:40 -04:00
parent 151c7eca4f
commit 7ebef76b24
7 changed files with 40 additions and 22 deletions
+14
View File
@@ -329,6 +329,18 @@ int w_getIcon(lua_State *L)
return 1;
}
int w_setScreenSaverEnabled(lua_State *L)
{
instance()->setScreenSaverEnabled(luax_toboolean(L, 1));
return 0;
}
int w_isScreenSaverEnabled(lua_State *L)
{
luax_pushboolean(L, instance()->isScreenSaverEnabled());
return 1;
}
int w_setTitle(lua_State *L)
{
std::string title = luax_checkstring(L, 1);
@@ -509,6 +521,8 @@ static const luaL_Reg functions[] =
{ "getPosition", w_getPosition },
{ "setIcon", w_setIcon },
{ "getIcon", w_getIcon },
{ "setScreenSaverEnabled", w_setScreenSaverEnabled },
{ "isScreenSaverEnabled", w_isScreenSaverEnabled },
{ "setTitle", w_setTitle },
{ "getTitle", w_getTitle },
{ "hasFocus", w_hasFocus },