Add love.window.getIcon, and reset it after setMode, so it doesn't get reset (issue #667 and issue #513)

This commit is contained in:
Bart van Strien
2013-07-09 15:19:49 +02:00
parent aaa301ead2
commit 25d0d87247
5 changed files with 30 additions and 0 deletions
+11
View File
@@ -189,6 +189,16 @@ int w_setIcon(lua_State *L)
return 0;
}
int w_getIcon(lua_State *L)
{
image::ImageData *i = instance->getIcon();
if (i)
luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void*) i);
else
lua_pushnil(L);
return 1;
}
int w_setCaption(lua_State *L)
{
std::string title = luax_checkstring(L, 1);
@@ -232,6 +242,7 @@ static const luaL_Reg functions[] =
{ "getHeight", w_getHeight },
{ "getDimensions", w_getDimensions },
{ "setIcon", w_setIcon },
{ "getIcon", w_getIcon },
{ "setCaption", w_setCaption },
{ "getCaption", w_getCaption },
{ "hasFocus", w_hasFocus },