mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Re-added love.graphics.getWidth/getHeight
This commit is contained in:
@@ -62,6 +62,25 @@ int w_isCreated(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_getWidth(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, instance->getWidth());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_getHeight(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, instance->getHeight());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_getDimensions(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, instance->getWidth());
|
||||
lua_pushinteger(L, instance->getHeight());
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_setScissor(lua_State *L)
|
||||
{
|
||||
if (lua_gettop(L) == 0)
|
||||
@@ -1514,6 +1533,9 @@ static const luaL_Reg functions[] =
|
||||
{ "printf", w_printf },
|
||||
|
||||
{ "isCreated", w_isCreated },
|
||||
{ "getWidth", w_getWidth },
|
||||
{ "getHeight", w_getHeight },
|
||||
{ "getDimensions", w_getDimensions },
|
||||
|
||||
{ "setScissor", w_setScissor },
|
||||
{ "getScissor", w_getScissor },
|
||||
|
||||
@@ -42,6 +42,9 @@ int w_reset(lua_State *L);
|
||||
int w_clear(lua_State *L);
|
||||
int w_present(lua_State *L);
|
||||
int w_isCreated(lua_State *L);
|
||||
int w_getWidth(lua_State *L);
|
||||
int w_getHeight(lua_State *L);
|
||||
int w_getDimensions(lua_State *L);
|
||||
int w_setScissor(lua_State *L);
|
||||
int w_getScissor(lua_State *L);
|
||||
int w_setStencil(lua_State *L);
|
||||
|
||||
Reference in New Issue
Block a user