Shader:send now optionally accepts a Data object (with optional byte offset and size parameters). Resolves issue #1343.

Also changed the optional 'columnMajor' argument of the matrix variant of Shader:send and Transform:setMatrix to accept enum constants instead. Valid values are "row" and "column".

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-09-23 19:47:57 -03:00
parent 77663ed847
commit 5f64737956
6 changed files with 178 additions and 26 deletions
+7 -2
View File
@@ -135,9 +135,14 @@ int w_Transform_setMatrix(lua_State *L)
bool columnmajor = false;
int idx = 2;
if (lua_isboolean(L, idx))
if (lua_type(L, idx) == LUA_TSTRING)
{
columnmajor = luax_toboolean(L, idx);
const char *layoutstr = lua_tostring(L, idx);
Transform::MatrixLayout layout;
if (!Transform::getConstant(layoutstr, layout))
return luaL_error(L, "Invalid matrix layout: %s", layoutstr);
columnmajor = (layout == Transform::MATRIX_COLUMN_MAJOR);
idx++;
}