Add Buffer methods

flush, setArrayData, setElement, getElement, getElementCount, getElementStride, getSize, getFormat
This commit is contained in:
Alex Szpakowski
2020-07-25 19:48:54 -03:00
parent 1d087cc5c2
commit d75f5df80d
6 changed files with 264 additions and 6 deletions
@@ -226,6 +226,9 @@ int w_SpriteBatch_attachAttribute(lua_State *L)
{
Mesh *mesh = luax_checktype<Mesh>(L, 3);
buffer = mesh->getVertexBuffer();
if (buffer == nullptr)
return luaL_error(L, "Mesh does not have its own vertex buffer.");
luax_markdeprecated(L, "SpriteBatch:attachAttribute(name, mesh)", API_METHOD, DEPRECATED_REPLACED, "SpriteBatch:attachAttribute(name, buffer)");
}
luax_catchexcept(L, [&](){ t->attachAttribute(name, buffer); });