Actually set shader uniforms;

This commit is contained in:
bjorn 2018-08-06 13:44:46 -07:00
parent 175de8924f
commit 78d9cc0031
1 changed files with 6 additions and 0 deletions

View File

@ -183,6 +183,12 @@ int l_lovrShaderSend(lua_State* L) {
}
luax_checkuniform(L, 3, uniform, tempData.data, name);
switch (uniform->type) {
case UNIFORM_FLOAT: lovrShaderSetFloat(shader, uniform->name, tempData.data, uniform->count * uniform->components); break;
case UNIFORM_INT: lovrShaderSetInt(shader, uniform->name, tempData.data, uniform->count * uniform->components); break;
case UNIFORM_MATRIX: lovrShaderSetMatrix(shader, uniform->name, tempData.data, uniform->count * uniform->components * uniform->components); break;
case UNIFORM_SAMPLER: lovrShaderSetTexture(shader, uniform->name, tempData.data, uniform->count); break;
}
return 0;
}