mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
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:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user