Browse Source

Exposed getTextureDimensions on Quad

EntranceJew 9 years ago
parent
commit
b2b02c4f8e
1 changed files with 11 additions and 0 deletions
  1. 11 0
      src/modules/graphics/wrap_Quad.cpp

+ 11 - 0
src/modules/graphics/wrap_Quad.cpp

@@ -64,10 +64,21 @@ int w_Quad_getViewport(lua_State *L)
 	return 4;
 	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[] =
 static const luaL_Reg w_Quad_functions[] =
 {
 {
 	{ "setViewport", w_Quad_setViewport },
 	{ "setViewport", w_Quad_setViewport },
 	{ "getViewport", w_Quad_getViewport },
 	{ "getViewport", w_Quad_getViewport },
+	{ "getTextureDimensions", w_Quad_getTextureDimensions },
 	{ 0, 0 }
 	{ 0, 0 }
 };
 };