addVec4Uniform method
- add VEC4
Implementation
bool addVec4Uniform(String name, List<double> val) {
assert(
val.length == 4,
"Assert error: vec4 has 4 doubles."
"You have passed a list with ${val.length}");
ffi.Pointer<ffi.Float> valT = calloc(ffi.sizeOf<ffi.Float>() * 4);
for (int i = 0; i < val.length; ++i) {
valT[i] = val[i];
}
int ret = _addUniform(
name.toNativeUtf8().cast<ffi.Char>(),
UniformType.uniformVec4.index,
valT.cast<ffi.Void>(),
);
calloc.free(valT);
return ret == 0 ? false : true;
}