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