mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
Exposed getTextureDimensions on Quad
This commit is contained in:
@@ -64,10 +64,21 @@ int w_Quad_getViewport(lua_State *L)
|
||||
return 4;
|
||||
}
|
||||
|
||||
int w_Quad_getTextureDimensions(lua_State *L)
|
||||
{
|
||||
Quad *quad = luax_checkquad(L, 1);
|
||||
double sw = quad->getTextureWidth();
|
||||
double sh = quad->getTextureHeight();
|
||||
lua_pushnumber(L, sw);
|
||||
lua_pushnumber(L, sh);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static const luaL_Reg w_Quad_functions[] =
|
||||
{
|
||||
{ "setViewport", w_Quad_setViewport },
|
||||
{ "getViewport", w_Quad_getViewport },
|
||||
{ "getTextureDimensions", w_Quad_getTextureDimensions },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user