add texture:getDebugName and buffer:getDebugName

This commit is contained in:
niki
2023-12-14 00:09:08 +01:00
parent 834398335d
commit 7a25dfa7fc
15 changed files with 47 additions and 25 deletions
+12
View File
@@ -413,6 +413,17 @@ static int w_Buffer_isBufferType(lua_State *L)
return 1;
}
static int w_Buffer_getDebugName(lua_State *L)
{
Buffer *t = luax_checkbuffer(L, 1);
const Optional<std::string> &debugName = t->getDebugName();
if (debugName.hasValue)
luax_pushstring(L, debugName.value);
else
lua_pushnil(L);
return 1;
}
static const luaL_Reg w_Buffer_functions[] =
{
{ "setArrayData", w_Buffer_setArrayData },
@@ -422,6 +433,7 @@ static const luaL_Reg w_Buffer_functions[] =
{ "getSize", w_Buffer_getSize },
{ "getFormat", w_Buffer_getFormat },
{ "isBufferType", w_Buffer_isBufferType },
{ "getDebugName", w_Buffer_getDebugName },
{ 0, 0 }
};