mirror of https://github.com/bjornbytes/lovr.git
Actually set shader uniforms;
This commit is contained in:
parent
175de8924f
commit
78d9cc0031
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue